Skip to content

Commit 7676244

Browse files
committed
ci: add prod workflow
1 parent 3d30acb commit 7676244

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/flutter-prod.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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-file: pubspec.yaml
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+
40+
deploy-example-web:
41+
runs-on: ubuntu-latest
42+
needs: build
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Setup Flutter build environment
48+
uses: subosito/flutter-action@v2
49+
with:
50+
flutter-version-file: example/pubspec.yaml
51+
channel: 'stable'
52+
cache: true
53+
54+
- run: flutter config --enable-web
55+
- run: cd ./example; flutter build web --release --target=lib/main.dart --output=build/web
56+
57+
- name: Archive Production Artifact
58+
uses: actions/upload-artifact@master
59+
with:
60+
name: web-build
61+
path: example/build/web
62+
63+
- name: Firebase Deploy
64+
uses: FirebaseExtended/action-hosting-deploy@v0
65+
with:
66+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
67+
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_JS_NOTIFICATIONS_WEB }}'
68+
projectId: js-notifications-web
69+

0 commit comments

Comments
 (0)