Actualiser .gitea/workflows/deploy-canary.yml

This commit is contained in:
moham committed 2025-09-19 12:08:37 +02:00
1 parent 475b9d0097
commit 9278ce9e36
1 file changed
+23 -6
+23 -6
View File
@@ -60,13 +60,30 @@ jobs:
- name: Deploy to CANARY
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USER }}
host: ${{ secrets.SSH_HOST }} # srv.ephaitek.com
port: ${{ secrets.SSH_PORT }} # 2224
username: ${{ secrets.SSH_USER }} # deployer
key: ${{ secrets.SSH_KEY }}
script_stop: true
envs: DEPLOY_PULL_TOKEN
script: |
set -euo pipefail
cd /srv/ihm/app/IHMKOS
git pull --rebase --ff-only
# (au cas où) éviter "dubious ownership" si ça réapparaît
git config --global --add safe.directory /srv/ihm/app/IHMKOS || true
# Auth HTTPS non interactive via .netrc (éphémère)
umask 077
cat > ~/.netrc <<EOF
machine ephagit.ephaitek.com
login moham
password ${DEPLOY_PULL_TOKEN}
EOF
# Pull du code
git -C /srv/ihm/app/IHMKOS pull --rebase --ff-only
# Nettoyage
rm -f ~/.netrc
# Redémarrer le canary
/srv/ihm/scripts/docker-run-canary.sh