-
Notifications
You must be signed in to change notification settings - Fork 40
46 lines (40 loc) · 1.42 KB
/
deploy_backend.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: Deploy Backend
on:
schedule:
- cron: '30 */12 * * *'
push:
paths:
- 'core/**'
- 'Dockerfile'
branches:
- master
- deploy
pull_request:
paths:
- 'core/**'
branches:
- 'deploy'
workflow_dispatch:
jobs:
deploy:
name: Deploy job
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v1
- name: Build Docker image
run: |
docker build . --tag us.gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }}
- name: Authenticate into Google Cloud Platform
uses: google-github-actions/setup-gcloud@master
with:
service_account_email: ${{ secrets.GCLOUD_EMAIL }}
service_account_key: ${{ secrets.GCLOUD_AUTH }}
- name: Configure Docker to use Google Cloud Platform
run: "gcloud auth configure-docker --quiet"
- name: Push image to Google Cloud Container Registry
run: docker push us.gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }}
- name: Install beta commands and deploy on cloud run
run: |
gcloud components install beta --quiet
gcloud beta run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image us.gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region ${{ secrets.GCLOUD_REGION }} --platform managed