Files
chopin-frontend/.gitea/workflows/deploy.yml
Raphix 76017d20b2
Some checks failed
Frontend Deployment / deploy-frontend (push) Failing after 11s
Version 1.0.0 - Frontend Pipeline
2025-08-29 00:38:26 +02:00

49 lines
1.3 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Frontend Deployment
on:
push:
branches:
- main
jobs:
deploy-frontend:
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'
# 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 }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan alpha.raphix.fr >> ~/.ssh/known_hosts
# 5⃣ Copier le build sur alpha
- name: Deploy frontend to Alpha
run: |
rsync -av --delete chopin-frontend/dist/ raphix@alpha.raphix.fr:/home/gitlab-ci/chopin-frontend/dist/
# 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"