This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (45 loc) · 1.62 KB
/
deploy_prod.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
name: Deploy prod
on:
workflow_dispatch:
push:
branches:
- add-ci
env:
IMAGE_NAME_GAR: asia-northeast1-docker.pkg.dev/reearth/eukarya/notion-proxy
GCP_WORKLOAD_IDENTITY_PROVIDER: projects/950334725361/locations/global/workloadIdentityPools/github-oidc-pool/providers/github-provider
GCP_SERVICE_ACCOUNT: reearth-prod-github-oidc@reearth.iam.gserviceaccount.com
GCP_REGION: asia-northeast1
jobs:
# TODO: Refactor with and env param
build:
uses: ./.github/workflows/_build.yaml
with:
workload_identity_provider: projects/950334725361/locations/global/workloadIdentityPools/github-oidc-pool/providers/github-provider
service_account: reearth-prod-github-oidc@reearth.iam.gserviceaccount.com
gar_repository: asia-northeast1-docker.pkg.dev
gar_dst: asia-northeast1-docker.pkg.dev/reearth/eukarya/notion-proxy
deploy:
runs-on: ubuntu-latest
needs: build
if: ${{ !failure() && github.ref_name == 'add-ci' }}
permissions:
contents: read
id-token: write
packages: read
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ env.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ env.GCP_SERVICE_ACCOUNT }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Deploy to Cloud Run
run: |
gcloud run deploy reearth-help \
--image $IMAGE_NAME \
--region $GCP_REGION \
--platform managed \
--quiet
env:
IMAGE_NAME: ${{ env.IMAGE_NAME_GAR }}:latest