Skip to content

Commit

Permalink
docs : these env can be set in github action env
Browse files Browse the repository at this point in the history
  • Loading branch information
jason810496 committed Jan 22, 2024
1 parent f600b8d commit 5ee5e43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion working-action/google-cloudrun-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ on:
push:
branches: [ "main" , "develop" , "stage" ]

# TODO : set this on GitHub Environment Variables
env:
PROJECT_ID: tsmc-test-412003 # TODO: update Google Cloud project id
GAR_LOCATION: asia-east1 # TODO: update Artifact Registry location
Expand Down Expand Up @@ -119,7 +120,10 @@ jobs:
- name: Build and Push Container
run: |-
docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" ${{ env.BUILD_PATH }}
docker login -u oauth2accesstoken --password $(gcloud auth print-access-token) https://${{ env.GAR_LOCATION }}-docker.pkg.dev
gcp_access_token=$(gcloud auth print-access-token)
docker login -u oauth2accesstoken --password-stdin https://${{ env.GAR_LOCATION }}-docker.pkg.dev <<< ${gcp_access_token}
docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}"
# END - Docker auth and build
Expand Down

0 comments on commit 5ee5e43

Please sign in to comment.