deploy: add workflow for beta
This commit is contained in:
@@ -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"
|
||||||
Reference in New Issue
Block a user