Version 1.0.0 - Frontend Pipeline
Some checks failed
Frontend Deployment / deploy-frontend (push) Failing after 11s

This commit is contained in:
2025-08-29 00:38:26 +02:00
parent 4eb6492247
commit 76017d20b2

View File

@@ -10,23 +10,24 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# 1⃣ Checkout du code
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
# 2⃣ Setup Node.js (ici Node 22)
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 22 node-version: '22'
cache: 'npm'
- name: Install dependencies # 3⃣ Installer les dépendances et builder le frontend
run: | - name: Build frontend
npm ci
- name: Build Vite frontend
run: | run: |
cd chopin-frontend
npm install --omit=dev
npm run build npm run build
# 4⃣ Setup SSH pour la connexion vers alpha
- name: Setup SSH - name: Setup SSH
env: env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
@@ -34,28 +35,14 @@ jobs:
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H alpha.raphix.fr >> ~/.ssh/known_hosts ssh-keyscan alpha.raphix.fr >> ~/.ssh/known_hosts
- name: Deploy frontend to alpha # 5⃣ Copier le build sur alpha
- name: Deploy frontend to Alpha
run: | run: |
ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr << 'EOF' rsync -av --delete chopin-frontend/dist/ raphix@alpha.raphix.fr:/home/gitlab-ci/chopin-frontend/dist/
sudo su - gitlab-ci << 'INNER_EOF'
set -e
echo "[Frontend-Deploy] - START" # 6⃣ Ajuster permissions sur alpha si nécessaire
- name: Set permissions on Alpha
# Nettoyage ancien build run: |
rm -rf /home/gitlab-ci/chopin-frontend/dist ssh raphix@alpha.raphix.fr "sudo chown -R gitlab-ci:gitlab-ci /home/gitlab-ci/chopin-frontend/dist"
rm -rf /home/gitlab-ci/chopin-frontend/node_modules
# Copier les fichiers build depuis le workspace CI
mkdir -p /home/gitlab-ci/chopin-frontend
rsync -av --delete /workspace/subsonics/chopin-frontend/dist/ /home/gitlab-ci/chopin-frontend/dist/
# Reinstaller les dépendances pour npm scripts côté serveur si nécessaire
cd /home/gitlab-ci/chopin-frontend
npm ci --omit=dev
echo "[Frontend-Deploy] - END"
INNER_EOF
EOF