-
Notifications
You must be signed in to change notification settings - Fork 7
68 lines (60 loc) · 1.95 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: main
concurrency:
group: main
on:
push:
branches:
- main
paths:
- ".fvm/**"
- "lib/**"
- "assets/**"
- "fonts/**"
- "web/**"
- "pubspec.yaml"
- "pubspec.lock"
- ".github/workflows/main.yml"
- "firebase.json"
- ".firebaserc"
# Set permissions to none.
#
# Using the broad default permissions is considered a bad security practice
# and would cause alerts from our scanning tools.
permissions: {}
jobs:
build_and_deploy:
runs-on: ubuntu-22.04
permissions:
checks: write # for FirebaseExtended/action-hosting-deploy
strategy:
matrix:
environment:
- name: prod
firebaseServiceAccount: FIREBASE_SERVICE_ACCOUNT_ANKIGPT_PROD
projectId: ankigpt-prod
flavor: prod
- name: dev
firebaseServiceAccount: FIREBASE_SERVICE_ACCOUNT_ANKIGPT_DEV
projectId: ankigpt-dev
flavor: dev
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: Set Flutter version from FVM config file to environment variables
uses: kuhnroyal/flutter-fvm-config-action@e91317131a2da710b9cd9b7a24f2c0ade9eeb61d
- uses: subosito/flutter-action@main
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
- name: Build
run: |
flutter build web \
--web-renderer canvaskit \
--dart-define=RELEASE_DATE="$(date +"%B %e %Y")" \
--dart-define=FLAVOR="${{ matrix.environment.flavor }}"
- uses: FirebaseExtended/action-hosting-deploy@120e124148ab7016bec2374e5050f15051255ba2
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets[matrix.environment.firebaseServiceAccount] }}"
channelId: live
target: ankigpt-app
projectId: "${{ matrix.environment.projectId }}"