Actualiser .gitea/workflows/deploy-canary.yml
This commit is contained in:
1 parent
975984c6fa
commit
242c725c06
1 file changed
+22
-8
@@ -2,15 +2,30 @@ name: deploy-canary
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
workflow_dispatch: {}
|
paths:
|
||||||
concurrency:
|
- "app.py"
|
||||||
group: deploy-canary
|
- "config.py"
|
||||||
cancel-in-progress: true
|
- "templates/**"
|
||||||
|
- ".gitea/workflows/deploy-canary.yml"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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
|
- name: Deploy to CANARY
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
with:
|
with:
|
||||||
@@ -18,10 +33,9 @@ jobs:
|
|||||||
port: ${{ secrets.SSH_PORT }}
|
port: ${{ secrets.SSH_PORT }}
|
||||||
username: ${{ secrets.SSH_USER }}
|
username: ${{ secrets.SSH_USER }}
|
||||||
key: ${{ secrets.SSH_KEY }}
|
key: ${{ secrets.SSH_KEY }}
|
||||||
token: ${{ secrets.ACTIONS_PAT }}
|
script_stop: true
|
||||||
script: |
|
script: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd /srv/ihm/app/IHMKOS
|
cd /srv/ihm/app/IHMKOS
|
||||||
git fetch --all
|
git pull --rebase --ff-only
|
||||||
git reset --hard origin/main
|
|
||||||
/srv/ihm/scripts/docker-run-canary.sh
|
/srv/ihm/scripts/docker-run-canary.sh
|
||||||
Reference in new issue
Block a user