-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.14 KB
/
ci-client.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Frontend Client CI
on:
push:
branches:
- main
paths:
- client/**
- api/typescript/**
- .github/workflows/ci-frontend-client.yaml
- .github/workflows/_check-node.yaml
- pnpm-lock.yaml
pull_request:
paths:
- client/**
- api/typescript/**
- .github/workflows/ci-frontend-client.yaml
- .github/workflows/_check-node.yaml
- pnpm-lock.yaml
workflow_dispatch:
workflow_call:
permissions:
actions: read
contents: read
id-token: write
env:
GCP_PROJECT_ID: ${{ startsWith(github.ref_name, 'release/') && 'aiceo-prod' || 'aiceo-dev'}}
GCP_PROJECT_NUMBER: ${{ startsWith(github.ref_name, 'release/') && '1004160178879' || '285404307541'}}
jobs:
check:
uses: ./.github/workflows/_check-node.yaml
with:
project_dir: client
secrets: inherit
deploy:
needs: check
runs-on: ubuntu-22.04
environment: ${{ github.event_name != 'pull_request' && (startsWith(github.ref_name, 'release/') && 'prod' || 'dev') || null }}
env:
DOCKER_PUSH: ${{ github.event_name != 'pull_request' && 'yes' || 'no' }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: install dependencies
run: pnpm install
working-directory: client
- name: build app
run: pnpm run build
working-directory: client
env:
PUBLIC_ENV__FIREBASE_APP: ${{ env.GCP_PROJECT_ID }}
- if: ${{ env.DOCKER_PUSH == 'yes' }}
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/${{ env.GCP_PROJECT_NUMBER }}/locations/global/workloadIdentityPools/github/providers/github
project_id: ${{ env.GCP_PROJECT_ID }}
service_account: firebase-deployer@${{ env.GCP_PROJECT_ID }}.iam.gserviceaccount.com
- name: deploy app
if: ${{ env.DOCKER_PUSH == 'yes' }}
run: pnpm firebase --project=${{ env.GCP_PROJECT_ID }} deploy
working-directory: client