-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (38 loc) · 1.19 KB
/
google-cloudrun-docker.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
46
name: Build and Deploy to Cloud Run
on:
push:
branches: [ "main" ]
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Google Container Registry
uses: docker/login-action@v1
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.MUBAZIR }}
- name: Setup gcloud CLI
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.PROJECT_ID }}
service_account_key: ${{ secrets.MUBAZIR }}
export_default_credentials: true
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
no-cache: false
tags: ${{ secrets.GAR_LOCATION }}:latest
- name: Deploy to Cloud Run
run: |
gcloud run deploy ${{ secrets.SERVICE }} \
--image ${{ secrets.GAR_LOCATION }}:latest \
--region ${{ secrets.REGION }} \
--platform managed \
--allow-unauthenticated