Skip to content

Commit dda315b

Browse files
committed
ci: use paths-filter, push perms only to avoid schema deletions
1 parent 7585d76 commit dda315b

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,28 @@ on:
66
- main
77

88
jobs:
9+
changes:
10+
name: Detect changed files
11+
runs-on: ubuntu-latest
12+
outputs:
13+
tank: ${{ steps.filter.outputs.tank }}
14+
schema: ${{ steps.filter.outputs.schema }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: dorny/paths-filter@v3
18+
id: filter
19+
with:
20+
filters: |
21+
tank:
22+
- tank.json
23+
schema:
24+
- web/instant.schema.ts
25+
- web/instant.perms.ts
26+
927
deploy-tank:
1028
name: Deploy Tank Skill
11-
if: |
12-
contains(github.event.head_commit.modified, 'tank.json') ||
13-
contains(github.event.head_commit.added, 'tank.json')
29+
needs: changes
30+
if: needs.changes.outputs.tank == 'true'
1431
runs-on: ubuntu-latest
1532
steps:
1633
- uses: actions/checkout@v4
@@ -23,11 +40,8 @@ jobs:
2340

2441
push-schema:
2542
name: Push InstantDB Schema & Permissions
26-
if: |
27-
contains(github.event.head_commit.modified, 'web/instant.schema.ts') ||
28-
contains(github.event.head_commit.modified, 'web/instant.perms.ts') ||
29-
contains(github.event.head_commit.added, 'web/instant.schema.ts') ||
30-
contains(github.event.head_commit.added, 'web/instant.perms.ts')
43+
needs: changes
44+
if: needs.changes.outputs.schema == 'true'
3145
runs-on: ubuntu-latest
3246
defaults:
3347
run:
@@ -41,4 +55,4 @@ jobs:
4155
env:
4256
INSTANT_APP_ID: ${{ secrets.INSTANT_APP_ID }}
4357
INSTANT_ADMIN_TOKEN: ${{ secrets.INSTANT_ADMIN_TOKEN }}
44-
run: npx instant-cli push all --skip-check-types
58+
run: yes Yes | npx instant-cli push perms --app $INSTANT_APP_ID

0 commit comments

Comments
 (0)