1- name : Build and Deploy
1+ name : Flutter App CI/CD
22
33on :
44 push :
2424 runs-on : ubuntu-latest
2525 outputs :
2626 app : ${{ steps.filter.outputs.app }}
27- worker : ${{ steps.filter.outputs.worker }}
28- festivals : ${{ steps.filter.outputs.festivals }}
2927 steps :
3028 - name : Checkout
3129 uses : actions/checkout@v4
@@ -43,70 +41,14 @@ jobs:
4341 - 'android/**'
4442 - '.github/workflows/build-deploy.yml'
4543 - 'mise.toml'
46- worker:
47- - 'cloudflare-worker/**'
48- festivals:
49- - 'data/festivals.json'
50-
51- # Validate festivals.json against schema
52- validate-festivals :
53- needs : changes
54- runs-on : ubuntu-latest
55- if : needs.changes.outputs.festivals == 'true'
56- steps :
57- - name : Checkout
58- uses : actions/checkout@v4
59-
60- - name : Setup Node.js
61- uses : actions/setup-node@v4
62- with :
63- node-version : ' 20'
64- cache : ' npm'
65- cache-dependency-path : scripts/package-lock.json
66-
67- - name : Install validation dependencies
68- working-directory : scripts
69- run : npm ci
70-
71- - name : Validate festivals.json
72- run : node scripts/validate-festivals.js
73-
74- # Validate Cloudflare Worker on PRs (dry-run)
75- validate-worker :
76- needs : changes
77- runs-on : ubuntu-latest
78- if : |
79- github.event_name == 'pull_request' &&
80- (needs.changes.outputs.worker == 'true' || needs.changes.outputs.festivals == 'true')
81- steps :
82- - name : Checkout
83- uses : actions/checkout@v4
84-
85- - name : Setup Node.js
86- uses : actions/setup-node@v4
87- with :
88- node-version : ' 20'
89-
90- - name : Install worker dependencies
91- working-directory : cloudflare-worker
92- run : npm ci
93-
94- - name : Copy festivals.json to worker directory
95- run : cp data/festivals.json cloudflare-worker/festivals.json
96-
97- - name : Validate worker (dry-run)
98- uses : cloudflare/wrangler-action@v3
99- with :
100- apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
101- accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
102- workingDirectory : cloudflare-worker
103- command : deploy --dry-run
10444
10545 # Run tests once before building
10646 test :
10747 needs : changes
10848 runs-on : ubuntu-latest
109- if : needs.changes.outputs.app == 'true'
49+ if : |
50+ github.event_name == 'workflow_dispatch' ||
51+ needs.changes.outputs.app == 'true'
11052 steps :
11153 - name : Checkout
11254 uses : actions/checkout@v4
@@ -240,41 +182,6 @@ jobs:
240182 path : build/app/outputs/bundle/release/app-release.aab
241183 if-no-files-found : error
242184
243- deploy-worker :
244- needs : changes
245- runs-on : ubuntu-latest
246- if : |
247- github.ref == 'refs/heads/main' &&
248- (needs.changes.outputs.worker == 'true' || needs.changes.outputs.festivals == 'true')
249- steps :
250- - name : Checkout
251- uses : actions/checkout@v4
252-
253- - name : Setup Node.js
254- uses : actions/setup-node@v4
255- with :
256- node-version : ' 20'
257-
258- - name : Validate festivals.json
259- if : needs.changes.outputs.festivals == 'true'
260- run : |
261- cd scripts && npm ci
262- node validate-festivals.js
263-
264- - name : Install worker dependencies
265- working-directory : cloudflare-worker
266- run : npm ci
267-
268- - name : Copy festivals.json to worker directory
269- run : cp data/festivals.json cloudflare-worker/festivals.json
270-
271- - name : Deploy Cloudflare Worker
272- uses : cloudflare/wrangler-action@v3
273- with :
274- apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
275- accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
276- workingDirectory : cloudflare-worker
277-
278185 deploy-web :
279186 needs : build-web
280187 runs-on : ubuntu-latest
@@ -304,7 +211,9 @@ jobs:
304211 deploy-web-preview :
305212 needs : [changes, build-web]
306213 runs-on : ubuntu-latest
307- if : needs.changes.outputs.app == 'true'
214+ if : |
215+ github.event_name == 'workflow_dispatch' ||
216+ needs.changes.outputs.app == 'true'
308217 steps :
309218 - name : Download build artifact
310219 uses : actions/download-artifact@v4
0 commit comments