Skip to content

Commit bd628dd

Browse files
authored
Create google-cloudrun-docker.yml
1 parent 388e557 commit bd628dd

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
name: 'Deploy to Cloud Run'
3+
4+
on:
5+
workflow_run:
6+
workflows: [dbc]
7+
types:
8+
- completed
9+
10+
env:
11+
PROJECT_ID: '${{ secrets.GOOGLE_CLOUD_PROJECT_ID }}' # TODO: update to your Google Cloud project ID
12+
REGION: 'us-central1' # TODO: update to your region
13+
SERVICE: 'todo-demo-app' # TODO: update to your service name
14+
15+
jobs:
16+
deploy:
17+
runs-on: 'ubuntu-latest'
18+
19+
permissions:
20+
contents: 'read'
21+
id-token: 'write'
22+
23+
steps:
24+
- name: 'Checkout'
25+
uses: 'actions/checkout@v4' # actions/checkout@v4
26+
27+
- id: 'auth'
28+
name: 'Authenticate to Google Cloud'
29+
uses: 'google-github-actions/auth@v2' # google-github-actions/auth@v2
30+
with:
31+
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
32+
33+
- name: 'Deploy to Cloud Run'
34+
35+
uses: 'google-github-actions/deploy-cloudrun@v2'
36+
with:
37+
service: '${{ env.SERVICE }}'
38+
region: '${{ env.REGION }}'
39+
# NOTE: If using a pre-built image, update the image name below:
40+
41+
image: 'docker.io/olegselajev241/todo-demo-application:latest'
42+
43+
# If required, use the Cloud Run URL output in later steps
44+
- name: 'Show output'
45+
run: |2-
46+
47+
echo ${{ steps.deploy.outputs.url }}

0 commit comments

Comments
 (0)