ci: use paths-filter, push perms only to avoid schema deletions #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| changes: | |
| name: Detect changed files | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tank: ${{ steps.filter.outputs.tank }} | |
| schema: ${{ steps.filter.outputs.schema }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| tank: | |
| - tank.json | |
| schema: | |
| - web/instant.schema.ts | |
| - web/instant.perms.ts | |
| deploy-tank: | |
| name: Deploy Tank Skill | |
| needs: changes | |
| if: needs.changes.outputs.tank == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Tank CLI | |
| run: sudo curl -fsSL https://raw.githubusercontent.com/tankpkg/tank/main/install.sh | sudo sh | |
| - name: Publish to Tank Registry | |
| env: | |
| TANK_TOKEN: ${{ secrets.TANK_TOKEN }} | |
| run: tank publish | |
| push-schema: | |
| name: Push InstantDB Schema & Permissions | |
| needs: changes | |
| if: needs.changes.outputs.schema == 'true' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: web | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Push schema and permissions | |
| env: | |
| INSTANT_APP_ID: ${{ secrets.INSTANT_APP_ID }} | |
| INSTANT_ADMIN_TOKEN: ${{ secrets.INSTANT_ADMIN_TOKEN }} | |
| run: yes Yes | npx instant-cli push perms --app $INSTANT_APP_ID |