ci: only run Convex deploy when files in convex/** change (paths-filter)

This commit is contained in:
Esdras Renan 2025-10-08 14:23:11 -03:00
parent 2b707379bb
commit f9268346ea

View file

@ -11,6 +11,22 @@ env:
VPS_UPDATES_DIR: /var/www/updates VPS_UPDATES_DIR: /var/www/updates
jobs: jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
convex: ${{ steps.filter.outputs.convex }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Paths filter
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
convex:
- 'convex/**'
deploy: deploy:
name: Deploy (VPS Linux) name: Deploy (VPS Linux)
if: ${{ startsWith(github.ref, 'refs/heads/') }} if: ${{ startsWith(github.ref, 'refs/heads/') }}
@ -61,7 +77,8 @@ jobs:
convex_deploy: convex_deploy:
name: Deploy Convex functions name: Deploy Convex functions
needs: deploy needs: [deploy, changes]
if: ${{ needs.changes.outputs.convex == 'true' }}
runs-on: [ self-hosted, linux, vps ] runs-on: [ self-hosted, linux, vps ]
env: env:
APP_DIR: /srv/apps/sistema APP_DIR: /srv/apps/sistema