Skip to content

Commit 1fdd330

Browse files
committed
Use latest github action step
1 parent 1d685b5 commit 1fdd330

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

.github/workflows/gcr-deploy.yaml

+17-14
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
name: build
1+
name: deploy
22

33
on:
44
push:
55
branches:
66
- main
7+
78
workflow_dispatch:
89

910
# Environment variables available to all jobs and steps in this workflow
@@ -14,33 +15,35 @@ env:
1415
RUN_SERVICE: ${{ secrets.RUN_SERVICE }}
1516

1617
jobs:
17-
setup-build-deploy:
18-
name: Setup, Build, and Deploy
18+
deploy:
19+
name: Deploy to CloudRun
1920
runs-on: ubuntu-latest
2021

2122
steps:
2223
- name: Checkout
23-
uses: actions/checkout@v1
24+
uses: actions/checkout@v4
2425

25-
# Setup gcloud CLI
26-
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
26+
- name: gcloud auth
27+
id: 'auth'
28+
uses: 'google-github-actions/auth@v2'
2729
with:
28-
version: '275.0.0'
29-
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
30-
service_account_key: ${{ secrets.GCP_SA_KEY }}
30+
credentials_json: '${{ secrets.GCP_SA_KEY }}'
3131

32-
# Configure gcloud CLI
33-
- name: gcloud Set up
34-
run: |
35-
gcloud config set project ${RUN_PROJECT}
32+
# Setup gcloud CLI
33+
- name: gcloud setup
34+
uses: google-github-actions/setup-gcloud@v2
35+
36+
- name: gcloud docker-auth
37+
run: gcloud auth configure-docker
3638

3739
# Build and push image to Google Container Registry
3840
- name: Build
3941
run: |
4042
docker build \
4143
--build-arg COMMIT=${GITHUB_SHA:0:7} \
4244
--build-arg LASTMOD=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
43-
--tag gcr.io/${RUN_PROJECT}/${RUN_SERVICE}:$GITHUB_SHA .
45+
--tag gcr.io/${RUN_PROJECT}/${RUN_SERVICE}:$GITHUB_SHA \
46+
.
4447
4548
- name: GCloud auth to docker
4649
run: |

0 commit comments

Comments
 (0)