Skip to content

Commit 8ca5dd8

Browse files
WIP github action for running services.
1 parent ee8aa87 commit 8ca5dd8

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Run app services
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
8+
env:
9+
PROJECT_ID: 'benefit-decision-toolkit-play'
10+
WORKLOAD_IDENTITY_PROVIDER: 'projects/1034049717668/locations/global/workloadIdentityPools/github-actions-google-cloud/providers/github'
11+
12+
jobs:
13+
run-services:
14+
# Add these permissions for Workload Identity Federation
15+
permissions:
16+
contents: read
17+
id-token: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
# Devbox needs a .env file to exist, even if it's empty
24+
- name: 'Create .env file'
25+
run: touch .env
26+
27+
# Setup devbox which includes Node.js, Firebase CLI, and Google Cloud SDK
28+
- name: 'Install devbox'
29+
uses: 'jetify-com/[email protected]'
30+
with:
31+
enable-cache: true
32+
33+
# Configure Workload Identity Federation and generate an access token
34+
- id: 'auth'
35+
name: 'Authenticate to Google Cloud'
36+
uses: 'google-github-actions/auth@v2'
37+
with:
38+
workload_identity_provider: '${{ env.WORKLOAD_IDENTITY_PROVIDER }}'
39+
service_account: cicd-build-deploy-api@benefit-decision-toolkit-play.iam.gserviceaccount.com
40+
project_id: ${{ env.PROJECT_ID }}
41+
42+
- name: Cache node modules
43+
uses: actions/cache@v4
44+
with:
45+
path: builder-frontend/node_modules
46+
key: ${{ runner.os }}-node-${{ hashFiles('builder-frontend/package-lock.json') }}
47+
restore-keys: |
48+
${{ runner.os }}-node-
49+
50+
- name: Install dependencies
51+
working-directory: builder-frontend
52+
run: devbox run install-builder-frontend-ci
53+
54+
- name: Run all services
55+
run: devbox services up -b
56+
continue-on-error: true

0 commit comments

Comments
 (0)