-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.57 KB
/
frontend-ci.yaml
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
name: Preview Deploy to Firebase Hosting on merge
on:
pull_request:
types:
- opened
- synchronize
paths-ignore:
- "genkit/**"
jobs:
build_and_deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Read Flutter SDK version
run: echo "FLUTTER_VERSION=$(jq -r '.flutterSdkVersion' .fvm/fvm_config.json)" >> $GITHUB_ENV
shell: bash
- name: Create Firebase options file
run: |
cat <<EOF > ./lib/firebase_options.dart
${{ secrets.FIREBASE_CONFIG }}
EOF
- name: Create dot_env file
run: |
cat <<EOF > ./.env
${{ secrets.DOT_ENV }}
EOF
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: flutter pub get
run: flutter pub get
- name: flutter build web
run: flutter build web
- name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT_MAIL }}
create_credentials_file: true
export_environment_variables: true
- name: Preview Deploy to Firebase Hosting
run: |
npm install -g firebase-tools
firebase hosting:channel:deploy preview --project=${{ secrets.PROJECT_ID }}