diff --git a/.gitea/workflows/deploy-prod.yaml b/.gitea/workflows/deploy-prod.yaml new file mode 100644 index 0000000..b2a359a --- /dev/null +++ b/.gitea/workflows/deploy-prod.yaml @@ -0,0 +1,26 @@ +name: Deploiement API Prod Docker + +on: + push: + branches: + - main + +jobs: + deploy: + name: Build et Déploiement + runs-on: ubuntu-latest + + steps: + - name: 📥 Récupération du code source + uses: actions/checkout@v4 + + - name: 🔐 Injection des variables d'environnement + run: | + echo "PGSQL_CONNECTION=${{ secrets.PGSQL_CONNECTION }}" > .env + + - name: 🐳 Redémarrage Docker + run: | + echo "🚀 Démarrage du déploiement Docker sur api-prod..." + docker compose down + docker compose up -d --build + echo "✅ Déploiement terminé !" \ No newline at end of file diff --git a/compose.yaml b/compose.yaml index 979fbd6..dd0bc07 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,5 +3,7 @@ image: webzine.webapplication build: context: . - dockerfile: Webzine.WebApplication/Dockerfile - + ports: + - "8080:8080" + environment: + - ConnectionStrings__PostGreSQLConnection=${PGSQL_CONNECTION} \ No newline at end of file