52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
name: deploy-canary
|
||
on:
|
||
push:
|
||
branches: [ main ]
|
||
paths:
|
||
- "app.py"
|
||
- "config.py"
|
||
- "templates/**"
|
||
- ".gitea/workflows/deploy-canary.yml"
|
||
|
||
jobs:
|
||
deploy:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- name: Debug réseau/Git
|
||
run: |
|
||
set -x
|
||
getent hosts ephagit.ephaitek.com || true
|
||
head -n 50 /etc/hosts || true
|
||
nc -vz ephagit.ephaitek.com 443 || true
|
||
git config --global http.lowSpeedLimit 1000
|
||
git config --global http.lowSpeedTime 120
|
||
GIT_CURL_VERBOSE=1 GIT_TRACE=1 \
|
||
git ls-remote https://ephagit.ephaitek.com/ephaitek/IHMKOS.git | head -n2 || true
|
||
- name: Checkout (shallow + token)
|
||
uses: actions/checkout@v4
|
||
with:
|
||
token: ${{ secrets.CHECKOUT_TOKEN }} # ton PAT
|
||
fetch-depth: 1 # évite l’historique complet
|
||
# optionnel : ne sortir que les dossiers utiles au déploiement
|
||
sparse-checkout: |
|
||
app.py
|
||
config.py
|
||
templates
|
||
static
|
||
sparse-checkout-cone-mode: false
|
||
persist-credentials: false
|
||
|
||
- name: Deploy to CANARY
|
||
uses: appleboy/ssh-action@v1.0.3
|
||
with:
|
||
host: ${{ secrets.SSH_HOST }}
|
||
port: ${{ secrets.SSH_PORT }}
|
||
username: ${{ secrets.SSH_USER }}
|
||
key: ${{ secrets.SSH_KEY }}
|
||
script_stop: true
|
||
script: |
|
||
set -euo pipefail
|
||
cd /srv/ihm/app/IHMKOS
|
||
git pull --rebase --ff-only
|
||
/srv/ihm/scripts/docker-run-canary.sh
|