-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (32 loc) · 1.08 KB
/
backend-cd.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
name: backend-CD
on:
repository_dispatch:
types: ["backend_deploy_trigger"]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Google Auth
id: auth
uses: "google-github-actions/auth@v0"
with:
credentials_json: "${{ secrets.GCP_CREDENTIALS }}"
- name: GCR Auth
id: docker-auth
uses: "docker/login-action@v2"
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.GCP_CREDENTIALS }}
- name: Push Docker image to GCR
run: |-
docker pull jacobmichels/computer_nerd
docker tag jacobmichels/computer_nerd gcr.io/${{ secrets.GCP_PROJECT }}/computer_nerd
docker push gcr.io/${{ secrets.GCP_PROJECT }}/computer_nerd
- name: Deploy Cloud Run revision
uses: google-github-actions/deploy-cloudrun@v0
with:
service: ${{ secrets.GCP_CLOUDRUN_SERVICE }}
region: ${{ secrets.GCP_CLOUDRUN_REGION }}
image: gcr.io/${{ secrets.GCP_PROJECT }}/computer_nerd:latest