From 9773f88dc68d17c85f32bb2b7dc8e923623bce25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Thu, 14 May 2026 19:34:46 +0400 Subject: [PATCH] deploy: add workflow for beta --- .gitea/workflows/deploy-beta.yaml | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .gitea/workflows/deploy-beta.yaml diff --git a/.gitea/workflows/deploy-beta.yaml b/.gitea/workflows/deploy-beta.yaml new file mode 100644 index 0000000..9ffc07a --- /dev/null +++ b/.gitea/workflows/deploy-beta.yaml @@ -0,0 +1,60 @@ +name: Déploiement API BETA +run-name: ${{ gitea.actor }} est en cours de déploiement API BETA +on: + push: + branches: + - dev + +jobs: + test: + name: Tests extensions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + + - name: Installer les dépendances + run: npm ci + + - name: Lancer les tests + run: npm test + + deploy: + name: Déploiement beta + needs: test + runs-on: ubuntu-latest + steps: + - name: Déployer via SSH + uses: appleboy/ssh-action@v1.2.0 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + port: ${{ secrets.SSH_PORT }} + script: | + set -e + cd ${{ secrets.DEPLOY_PATH }} + + echo "==> Pull branche dev" + git pull origin dev + + echo "==> Build des extensions" + for ext in extensions/directus-extension-disallow-votes extensions/directus-extension-new-user; do + echo " Building $ext..." + cd "$ext" + npm ci + npm run build + cd - + done + + echo "==> Redémarrage Directus" + docker compose restart directus + + echo "==> Vérification santé" + sleep 5 + curl -sf http://localhost:8066/server/health | grep -q '"status":"ok"' + echo "Déploiement OK"