Version 1.0.0-rc2 - Modif Pipeline
Some checks failed
Frontend Deployment / deploy-frontend (push) Failing after 43s
Some checks failed
Frontend Deployment / deploy-frontend (push) Failing after 43s
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Frontend Deployment Pipeline
|
name: Frontend Deployment
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -10,8 +10,22 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
|
||||||
|
- name: Build Vite frontend
|
||||||
|
run: |
|
||||||
|
npm run build
|
||||||
|
|
||||||
- name: Setup SSH
|
- name: Setup SSH
|
||||||
env:
|
env:
|
||||||
@@ -20,26 +34,28 @@ 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
|
||||||
eval "$(ssh-agent -s)"
|
ssh-keyscan -H alpha.raphix.fr >> ~/.ssh/known_hosts
|
||||||
ssh-add ~/.ssh/id_rsa
|
|
||||||
ssh-keyscan git.raphix.fr >> ~/.ssh/known_hosts
|
|
||||||
|
|
||||||
- name: Build Frontend
|
- name: Deploy frontend to alpha
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
ssh -o StrictHostKeyChecking=no raphix@alpha.raphix.fr << 'EOF'
|
||||||
npm run build
|
sudo su - gitlab-ci << 'INNER_EOF'
|
||||||
|
|
||||||
- name: Deploy Frontend
|
|
||||||
run: |
|
|
||||||
scp -r dist/* raphix@alpha:/home/gitlab-ci/frontend/dist/
|
|
||||||
ssh -o StrictHostKeyChecking=no raphix@alpha << 'EOF'
|
|
||||||
sudo su - gitlab-ci -c '
|
|
||||||
set -e
|
set -e
|
||||||
echo "[Frontend-Deploy] - Stage - Déploiement - START"
|
|
||||||
|
|
||||||
# Assure les permissions
|
echo "[Frontend-Deploy] - START"
|
||||||
chown -R gitlab-ci:gitlab-ci /home/gitlab-ci/frontend/dist
|
|
||||||
|
|
||||||
echo "[Frontend-Deploy] - Stage - Déploiement - END"
|
# 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
|
EOF
|
||||||
|
Reference in New Issue
Block a user