This repository was archived by the owner on Jul 4, 2024. It is now read-only.
File tree 5 files changed +106
-28
lines changed
5 files changed +106
-28
lines changed Original file line number Diff line number Diff line change 6
6
type : string
7
7
service_account :
8
8
type : string
9
- gar_path :
9
+ gar_repository :
10
+ type : string
11
+ gar_dst :
10
12
type : string
11
13
jobs :
12
14
build :
13
15
runs-on : ubuntu-latest
14
16
permissions :
15
17
contents : read
16
18
packages : write
17
- actions : read
19
+ id-token : write
18
20
steps :
21
+ - name : Checkout
22
+ uses : actions/checkout@v4
19
23
- uses : google-github-actions/auth@v2
20
24
with :
21
25
workload_identity_provider : ${{ inputs.workload_identity_provider }}
@@ -24,13 +28,15 @@ jobs:
24
28
uses : google-github-actions/setup-gcloud@v2
25
29
- name : Set up Docker Buildx
26
30
uses : docker/setup-buildx-action@v3
31
+ - name : Log in to GAR
32
+ run : gcloud auth configure-docker ${{ inputs.gar_repository }} --quiet
27
33
- name : Build and push
28
34
id : docker_build
29
35
uses : docker/build-push-action@v5
30
36
with :
31
- context : ./server
32
- file : ./server/ Dockerfile.amd64
37
+ context : ./
38
+ file : ./Dockerfile.amd64
33
39
platforms : linux/amd64
34
40
push : true
35
41
tags : |
36
- ${{ inputs.gar_path }}:latest
42
+ ${{ inputs.gar_dst }}:latest
Original file line number Diff line number Diff line change 3
3
on :
4
4
push :
5
5
branches :
6
- - add-ci
6
+ - main
7
7
pull_request :
8
8
workflow_dispatch :
9
9
jobs :
@@ -12,22 +12,20 @@ jobs:
12
12
steps :
13
13
- name : Checkout
14
14
uses : actions/checkout@v4
15
-
16
15
- name : Setup Node.js
17
16
uses : actions/setup-node@v4
18
17
with :
19
18
node-version : ' 18.x'
20
-
21
19
- name : Dependencies
22
20
run : npm ci
23
-
24
21
- name : Test and Build
25
22
run : npm install -g pkg && npm test && npm run build
26
23
build :
27
- uses : ./.github/workflows/_build.yml
24
+ uses : ./.github/workflows/_build.yaml
28
25
needs : ci
29
- if : ${{ !failure() && github.ref_name == 'add-ci ' }}
26
+ if : ${{ !failure() && github.ref_name == 'main ' }}
30
27
with :
31
28
workload_identity_provider : projects/723082692741/locations/global/workloadIdentityPools/github-oidc-pool/providers/github-provider
32
29
service_account : reearth-dev-github-oidc@reearth-development.iam.gserviceaccount.com
33
- gcs_dst : gs://app.dev.reearth.io
30
+ gar_repository : asia-northeast1-docker.pkg.dev
31
+ gar_dst : asia-northeast1-docker.pkg.dev/reearth-development/eukarya/notion-proxy
Original file line number Diff line number Diff line change
1
+ name : Deploy dev
2
+ on :
3
+ workflow_dispatch :
4
+ env :
5
+ IMAGE_NAME_GAR : asia-northeast1-docker.pkg.dev/reearth-development/eukarya/notion-proxy
6
+ GCP_WORKLOAD_IDENTITY_PROVIDER : projects/723082692741/locations/global/workloadIdentityPools/github-oidc-pool/providers/github-provider
7
+ GCP_SERVICE_ACCOUNT : reearth-dev-github-oidc@reearth-development.iam.gserviceaccount.com
8
+ GCP_REGION : asia-northeast1
9
+ jobs :
10
+ deploy :
11
+ runs-on : ubuntu-latest
12
+ permissions :
13
+ contents : read
14
+ id-token : write
15
+ packages : read
16
+ steps :
17
+ - uses : actions/checkout@v4
18
+ - uses : google-github-actions/auth@v2
19
+ with :
20
+ workload_identity_provider : ${{ env.GCP_WORKLOAD_IDENTITY_PROVIDER }}
21
+ service_account : ${{ env.GCP_SERVICE_ACCOUNT }}
22
+ - name : Set up Cloud SDK
23
+ uses : google-github-actions/setup-gcloud@v2
24
+ - name : Deploy to Cloud Run
25
+ run : |
26
+ gcloud run deploy reearth-help \
27
+ --image $IMAGE_NAME \
28
+ --region $GCP_REGION \
29
+ --platform managed \
30
+ --quiet
31
+ env :
32
+ IMAGE_NAME : ${{ env.IMAGE_NAME_GAR }}:latest
Original file line number Diff line number Diff line change
1
+ name : Deploy prod
2
+ on :
3
+ workflow_dispatch :
4
+ env :
5
+ IMAGE_NAME_GAR : asia-northeast1-docker.pkg.dev/reearth/eukarya/notion-proxy
6
+ GCP_WORKLOAD_IDENTITY_PROVIDER : projects/950334725361/locations/global/workloadIdentityPools/github-oidc-pool/providers/github-provider
7
+ GCP_SERVICE_ACCOUNT :
[email protected]
8
+ GCP_REGION : asia-northeast1
9
+ jobs :
10
+ # TODO: Refactor with and env param
11
+ build :
12
+ uses : ./.github/workflows/_build.yaml
13
+ with :
14
+ workload_identity_provider : projects/950334725361/locations/global/workloadIdentityPools/github-oidc-pool/providers/github-provider
15
+ service_account :
[email protected]
16
+ gar_repository : asia-northeast1-docker.pkg.dev
17
+ gar_dst : asia-northeast1-docker.pkg.dev/reearth/eukarya/notion-proxy
18
+ deploy :
19
+ runs-on : ubuntu-latest
20
+ needs : build
21
+ if : ${{ !failure() }}
22
+ permissions :
23
+ contents : read
24
+ id-token : write
25
+ packages : read
26
+ steps :
27
+ - uses : actions/checkout@v4
28
+ - uses : google-github-actions/auth@v2
29
+ with :
30
+ workload_identity_provider : ${{ env.GCP_WORKLOAD_IDENTITY_PROVIDER }}
31
+ service_account : ${{ env.GCP_SERVICE_ACCOUNT }}
32
+ - name : Set up Cloud SDK
33
+ uses : google-github-actions/setup-gcloud@v2
34
+ - name : Deploy to Cloud Run
35
+ run : |
36
+ gcloud run deploy reearth-help \
37
+ --image $IMAGE_NAME \
38
+ --region $GCP_REGION \
39
+ --platform managed \
40
+ --quiet
41
+ env :
42
+ IMAGE_NAME : ${{ env.IMAGE_NAME_GAR }}:latest
You can’t perform that action at this time.
0 commit comments