-
Notifications
You must be signed in to change notification settings - Fork 5
65 lines (54 loc) · 2.13 KB
/
deploy-builder-frontend.yml
File metadata and controls
65 lines (54 loc) · 2.13 KB
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
name: Build and Deploy to Firebase Hosting
on:
push:
branches:
- main
env:
PROJECT_ID: 'benefit-decision-toolkit-play'
WORKLOAD_IDENTITY_PROVIDER: 'projects/1034049717668/locations/global/workloadIdentityPools/github-actions-google-cloud/providers/github'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
# Add these permissions for Workload Identity Federation
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Configure Workload Identity Federation and generate an access token.
#
# See https://github.com/google-github-actions/auth for more options,
# including authenticating via a JSON credentials file.
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: '${{ env.WORKLOAD_IDENTITY_PROVIDER }}'
service_account: cicd-build-deploy-api@benefit-decision-toolkit-play.iam.gserviceaccount.com
project_id: ${{ env.PROJECT_ID }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
working-directory: builder-frontend
run: npm ci
- name: Build application
working-directory: builder-frontend
run: npm run build
env:
VITE_API_URL: ${{ secrets.VITE_API_URL}}
VITE_SCREENER_BASE_URL: ${{ secrets.VITE_SCREENER_BASE_URL}}
VITE_API_KEY: ${{ secrets.VITE_API_KEY}}
VITE_AUTH_DOMAIN: ${{ secrets.VITE_AUTH_DOMAIN}}
VITE_PROJECT_ID: ${{ secrets.VITE_PROJECT_ID}}
VITE_STORAGE_BUCKET: ${{ secrets.VITE_STORAGE_BUCKET}}
VITE_MESSAGING_SENDER_ID: ${{ secrets.VITE_MESSAGING_SENDER_ID}}
VITE_APP_ID: ${{ secrets.VITE_APP_ID}}
VITE_MEASUREMENT_ID: ${{ secrets.VITE_MEASUREMENT_ID}}
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Deploy to Firebase Hosting
run: firebase deploy --only hosting:builder-frontend