ci/deploy: force rollout of web service via RELEASE_SHA + service update to pick new code

This commit is contained in:
Esdras Renan 2025-10-08 16:17:34 -03:00
parent 8b1715a3da
commit 27d78d6171
2 changed files with 8 additions and 1 deletions

View file

@ -73,7 +73,12 @@ jobs:
if: ${{ hashFiles(format('{0}/stack.yml', env.APP_DIR)) != '' }} if: ${{ hashFiles(format('{0}/stack.yml', env.APP_DIR)) != '' }}
run: | run: |
cd "$APP_DIR" cd "$APP_DIR"
docker stack deploy --with-registry-auth -c stack.yml sistema RELEASE_SHA=${{ github.sha }} docker stack deploy --with-registry-auth -c stack.yml sistema
- name: Ensure web service restarts with new code
if: ${{ hashFiles(format('{0}/stack.yml', env.APP_DIR)) != '' }}
run: |
docker service update --force sistema_web || true
convex_deploy: convex_deploy:
name: Deploy Convex functions name: Deploy Convex functions

View file

@ -21,6 +21,8 @@ services:
NPM_CONFIG_PRODUCTION: "false" NPM_CONFIG_PRODUCTION: "false"
# Mantém o SQLite fora do repositório # Mantém o SQLite fora do repositório
DATABASE_URL: "file:/app/data/db.sqlite" DATABASE_URL: "file:/app/data/db.sqlite"
# Usado para forçar novo rollout a cada deploy (setado pelo CI)
RELEASE_SHA: "${RELEASE_SHA:-dev}"
deploy: deploy:
mode: replicated mode: replicated
replicas: 1 replicas: 1