Merge pull request 'ajout-cicd' (#178) from ajout-cicd into dev

Reviewed-on: https://10.4.0.131/gitea/DI1-P4-E1/Webzine/pulls/178
Reviewed-by: j.vetu <josephine.vetu@diiage.org>
This commit is contained in:
c.bobin
2026-04-01 15:52:42 +02:00
2 changed files with 30 additions and 2 deletions

View File

@@ -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é !"

View File

@@ -3,5 +3,7 @@
image: webzine.webapplication
build:
context: .
dockerfile: Webzine.WebApplication/Dockerfile
ports:
- "8080:8080"
environment:
- ConnectionStrings__PostGreSQLConnection=${PGSQL_CONNECTION}