Files
aegis/.gitea/workflows/deploy-environments.yml
T
LathanDevers 74588fbd5d
Sécurité - Architecture Git-Flow / validate-flow (pull_request) Failing after 0s
🔍 Contrôle Qualité & Sécurité (QA) / 🛡️ Quality Gate & Security Check (pull_request) Failing after 4s
feat: add workflow git
2026-08-03 14:03:56 +02:00

84 lines
2.7 KiB
YAML

name: Déploiement AEGIS Portal
on:
push:
branches:
- dev
- test
- acc
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
GIT_SSL_NO_VERIFY: "true"
NODE_TLS_REJECT_UNAUTHORIZED: "0"
steps:
- name: Patch DNS local pour Gitea Runner
run: sudo echo "10.10.40.31 git.bunker.lan" | sudo tee -a /etc/hosts
- name: Configuration de Git pour SSL
run: git config --global http.sslVerify false
- name: Récupération du code
uses: actions/checkout@v4
- name: Configuration de Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Installation des dépendances
run: npm ci
- name: Compilation de la Build
env:
VITE_APP_ENV: ${{ github.ref_name }}
run: npm run build
- name: Installation de lftp
run: sudo apt-get update && sudo apt-get install -y lftp
- name: Routage et Déploiement FTP
env: # 1. On charge tous les secrets de manière sécurisée
SERVER: ${{ secrets.FTP_SERVER }}
DEV_U: ${{ secrets.DEV_FTP_USER }}
DEV_P: ${{ secrets.DEV_FTP_PASSWORD }}
TEST_U: ${{ secrets.TEST_FTP_USER }}
TEST_P: ${{ secrets.TEST_FTP_PASSWORD }}
ACC_U: ${{ secrets.ACC_FTP_USER }}
ACC_P: ${{ secrets.ACC_FTP_PASSWORD }}
PROD_U: ${{ secrets.PROD_FTP_USER }}
PROD_P: ${{ secrets.PROD_FTP_PASSWORD }}
BRANCH: ${{ github.ref_name }}
run: |
# 2. On attribue les bons identifiants selon la branche
if [ "$BRANCH" == "master" ]; then
TARGET_USER=$PROD_U; TARGET_PASS=$PROD_P; DOMAIN="aegis.gise.be"
elif [ "$BRANCH" == "acc" ]; then
TARGET_USER=$ACC_U; TARGET_PASS=$ACC_P; DOMAIN="acc-aegis.gise.be"
elif [ "$BRANCH" == "test" ]; then
TARGET_USER=$TEST_U; TARGET_PASS=$TEST_P; DOMAIN="test-aegis.gise.be"
else
TARGET_USER=$DEV_U; TARGET_PASS=$DEV_P; DOMAIN="dev-aegis.gise.be"
fi
echo "Déploiement de la branche [$BRANCH] vers le domaine [$DOMAIN]..."
# 3. Exécution du script FTP (notez le chemin adapté à HestiaCP)
cat << EOF > script.lftp
set ftp:passive-mode true
set ftp:ssl-allow no
set ssl:verify-certificate no
set net:timeout 5
set net:max-retries 2
set dns:fatal-timeout 2
open -u "${TARGET_USER}","${TARGET_PASS}" "${SERVER}"
cd home/${FTP_USER}
mirror -R --delete --verbose dist/ ./
quit
EOF
lftp -f script.lftp