Version 1.0.0 - Frontend Pipeline
Some checks failed
Frontend Deployment / deploy-frontend (push) Failing after 11s
Some checks failed
Frontend Deployment / deploy-frontend (push) Failing after 11s
This commit is contained in:
@@ -10,23 +10,24 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# 1️⃣ Checkout du code
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# 2️⃣ Setup Node.js (ici Node 22)
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 22
|
||||
cache: 'npm'
|
||||
node-version: '22'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm ci
|
||||
|
||||
- name: Build Vite frontend
|
||||
# 3️⃣ Installer les dépendances et builder le frontend
|
||||
- name: Build frontend
|
||||
run: |
|
||||
cd chopin-frontend
|
||||
npm install --omit=dev
|
||||
npm run build
|
||||
|
||||
# 4️⃣ Setup SSH pour la connexion vers alpha
|
||||
- name: Setup SSH
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
@@ -34,28 +35,14 @@ jobs:
|
||||
mkdir -p ~/.ssh
|
||||
echo "$SSH_PRIVATE_KEY" > ~/.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: |
|
||||
ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr << 'EOF'
|
||||
sudo su - gitlab-ci << 'INNER_EOF'
|
||||
set -e
|
||||
rsync -av --delete chopin-frontend/dist/ raphix@alpha.raphix.fr:/home/gitlab-ci/chopin-frontend/dist/
|
||||
|
||||
echo "[Frontend-Deploy] - START"
|
||||
|
||||
# Nettoyage ancien build
|
||||
rm -rf /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
|
||||
# 6️⃣ Ajuster permissions sur alpha si nécessaire
|
||||
- name: Set permissions on Alpha
|
||||
run: |
|
||||
ssh raphix@alpha.raphix.fr "sudo chown -R gitlab-ci:gitlab-ci /home/gitlab-ci/chopin-frontend/dist"
|
||||
|
Reference in New Issue
Block a user