Skip to content

Commit f438bda

Browse files
committed
ci: add github deploy flows
1 parent 6d2a018 commit f438bda

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/flutter-prod.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Flutter analyze, test & deploy example web app
7+
8+
on:
9+
push:
10+
branches: [ "prod" ]
11+
12+
workflow_dispatch:
13+
14+
jobs:
15+
build_and_test:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install Flutter
23+
uses: subosito/flutter-action@v2
24+
with:
25+
flutter-version: '3.22.0'
26+
channel: 'stable'
27+
cache: true
28+
29+
- run: flutter --version
30+
31+
- name: Install dependencies
32+
run: flutter pub get
33+
34+
- name: Analyze project source
35+
run: flutter analyze
36+
37+
- name: Run tests
38+
# run: flutter test --coverage
39+
run: echo "Ignoring tests for now."
40+
41+
deploy-example-web:
42+
runs-on: ubuntu-latest
43+
needs: build_and_test
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Setup Flutter build environment
49+
uses: subosito/flutter-action@v2
50+
with:
51+
flutter-version: '3.22.0'
52+
channel: 'stable'
53+
cache: true
54+
55+
- run: flutter config --enable-web
56+
- run: cd ./example; flutter build web --release --target=lib/main.dart --output=build/web
57+
58+
- name: Archive Production Artifact
59+
uses: actions/upload-artifact@master
60+
with:
61+
name: web-build
62+
path: example/build/web
63+
64+
- name: Firebase Deploy
65+
uses: FirebaseExtended/action-hosting-deploy@v0
66+
with:
67+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
68+
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_WEB_CALLKIT }}'
69+
projectId: web-callkit
70+
channelId: live
71+

0 commit comments

Comments
 (0)