merge works of morning 04/06/2026 #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD — NexaCloud API | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| # ── Job 1 : Qualité ──────────────────────────────────────────────── | |
| qualite: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: pip install -r ressources/requirements.txt | |
| - name: Lint | |
| run: flake8 ressources/ --config ressources/.flake8 | |
| - name: Tests | |
| run: pytest ressources/ -v --cov=ressources | |
| # ── Job 2 : Staging ─────────────────────────────────────────────── | |
| staging: | |
| runs-on: ubuntu-latest | |
| needs: qualite # attend que le job qualite réussisse | |
| environment: staging | |
| if: github.ref_name == 'main' # uniquement sur la branche main | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Installer les dépendances | |
| run: pip install -r ressources/requirements.txt | |
| - name: Déployer sur Azure App Service (staging) | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: nexacloud-api-10909" | |
| publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_STAGING }} | |
| package: ressources/ | |
| # TODO: ajouter le step de déploiement sur Azure App Service | |
| # (remplacez app-name par votre nom d'application) | |
| # ── Job 3 : Production ──────────────────────────────────────────── | |
| production: | |
| runs-on: ubuntu-latest | |
| needs: staging | |
| environment: production | |
| if: github.ref_name == 'main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Installer les dépendances | |
| run: pip install -r ressources/requirements.txt | |
| - name: Déployer sur Azure App Service (production) | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: "nexacloud-api-10909" | |
| publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PRODUCTION }} | |
| package: ressources/ |