This commit is contained in:
@@ -14,21 +14,13 @@ jobs:
|
|||||||
- name: Deploy via SSH
|
- name: Deploy via SSH
|
||||||
run: |
|
run: |
|
||||||
ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_home root@home.mesdonneesadministratives.fr "
|
ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_home root@home.mesdonneesadministratives.fr "
|
||||||
# 1. Alignement strict du code source sur la branche main
|
|
||||||
cd /opt/alapatch &&
|
cd /opt/alapatch &&
|
||||||
git fetch --all &&
|
git fetch --all &&
|
||||||
git reset --hard origin/main &&
|
git reset --hard origin/main &&
|
||||||
|
docker build --no-cache -t alapatch-prod . &&
|
||||||
# 2. Nettoyage des anciennes dépendances
|
if [ \$(docker ps -aq -f name=microkorg-editor) ]; then
|
||||||
rm -rf node_modules build &&
|
docker stop microkorg-editor &&
|
||||||
|
docker rm microkorg-editor
|
||||||
# 3. Compilation locale sur le Node v22 du serveur de destination
|
fi &&
|
||||||
npm install --legacy-peer-deps &&
|
docker run -d --restart unless-stopped -p 4321:4321 --name microkorg-editor alapatch-prod
|
||||||
npm run build &&
|
|
||||||
|
|
||||||
# 4. Nettoyage de l'ancien processus en tâche de fond sur le port 4321
|
|
||||||
fuser -k 4321/tcp || true &&
|
|
||||||
|
|
||||||
# 5. Lancement isolé en tâche de fond (0.0.0.0 écoute sur toutes les interfaces)
|
|
||||||
nohup npx serve -s build -l 4321 > /dev/null 2>&1 &
|
|
||||||
"
|
"
|
||||||
Reference in New Issue
Block a user