fix: commentaires des actions de groupes visibles dans la fiche des p… #1006
This file contains 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: Deploy preprod | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 10 # On récupère les 10 derniers commits | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
# On vérifie si le dossier website a été modifié pour faire un build | |
- name: Check for changes in website directory | |
id: check_changes_website | |
run: | | |
echo "WEBSITE_CHANGED=false" >> $GITHUB_ENV | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep 'website/'; then | |
echo "WEBSITE_CHANGED=true" >> $GITHUB_ENV | |
fi | |
# On build seulement si le dossier website a été modifié | |
- name: Build website | |
if: env.WEBSITE_CHANGED == 'true' | |
env: | |
NEXT_TELEMETRY_DISABLED: 1 | |
run: | | |
cd website | |
yarn | |
yarn build | |
# On vérifie si le dossier dashboard a été modifié pour faire un build | |
- name: Check for changes in dashboard directory | |
id: check_changes_dashboard | |
run: | | |
echo "DASHBOARD_CHANGED=false" >> $GITHUB_ENV | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep 'dashboard/'; then | |
echo "DASHBOARD_CHANGED=true" >> $GITHUB_ENV | |
fi | |
# On build seulement si le dossier dashboard a été modifié | |
- name: Build dashboard | |
if: env.DASHBOARD_CHANGED == 'true' | |
run: | | |
cd dashboard | |
yarn | |
yarn build | |
# TODO pour plus tard, on pourrait deploy seulement le dossier qui a été modifié | |
- name: Trigger deployment preprod | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
run: | | |
curl -f -X POST -H "Content-Type: application/json" -d '{"deploy-key":"'"$DEPLOY_KEY"'", "commit":"'"${{ github.sha }}"'"}' https://preprod-api-mano.sesan.fr/api/deploy |