Files
budget-commun/.gitea/workflows/deploy.yml
T
alexandre grondin 1009279039
Build & Deploy / deploy (push) Successful in 15s
ci: mise à jour version via docker run plutôt que SSH
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 13:14:16 +02:00

46 lines
1.5 KiB
YAML

name: Build & Deploy
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login au registry
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | \
docker login registry.maisongrondin.fr \
-u ${{ secrets.REGISTRY_USERNAME }} \
--password-stdin
- name: Build et push vers le registry
run: |
docker build \
-t registry.maisongrondin.fr/alexandre/budget-commun:${{ gitea.ref_name }} \
-t registry.maisongrondin.fr/alexandre/budget-commun:latest \
-f backend/Dockerfile .
docker push registry.maisongrondin.fr/alexandre/budget-commun:${{ gitea.ref_name }}
docker push registry.maisongrondin.fr/alexandre/budget-commun:latest
- name: Mettre à jour la version sur TrueNAS
run: |
docker run --rm \
-v /mnt/.ix-apps/app_configs/budget-commun/versions/1.0.0:/app \
alpine:3 sh -c \
"sed -i 's/\"app_version\": \".*\"/\"app_version\": \"${{ gitea.ref_name }}\"/' /app/app.yaml && \
sed -i 's/^\"version\": \".*\"/\"version\": \"${{ gitea.ref_name }}\"/' /app/app.yaml"
- name: Redéployer sur TrueNAS
run: |
curl -sf -X POST http://172.16.11.1/api/v2.0/app/redeploy \
-H "Authorization: Bearer ${{ secrets.TRUENAS_API_KEY }}" \
-H "Content-Type: application/json" \
-d '"budget-commun"'