-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.38 KB
/
deploy.yml
File metadata and controls
49 lines (42 loc) · 1.38 KB
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
47
48
49
name: MLFlowservice
on:
push:
branches:
- main
env:
REGION: "asia-southeast1"
SERVICE: "mlflow-stc"
GOOGLE_CLOUD_PROJECT: "${{ secrets.GCP_PROJECT_ID }}"
GOOGLE_CLOUD_KEYFILE: "${{ secrets.GCP_SA_KEY }}"
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v2
- id: "auth"
uses: "google-github-actions/auth@v0"
with:
credentials_json: "${{ secrets.GCP_SA_KEY }}"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
- name: Configure Docker to use the gcloud command-line tool as a credential helper
run: |-
# Set up docker to authenticate
# via gcloud command-line tool.
gcloud auth configure-docker
- name: Build and Push Docker Image
run: |-
# Build the container on Cloud Build
gcloud builds submit --tag gcr.io/${{ secrets.GCP_PROJECT_ID }}/mlflow-stc
- name: Deploy to Cloud Run
id: deploy
uses: google-github-actions/deploy-cloudrun@v0
with:
service: ${{ env.SERVICE }}
region: ${{ env.REGION }}
image: gcr.io/${{ secrets.GCP_PROJECT_ID }}/mlflow-stc
- name: Show Output
run: echo ${{ steps.deploy.outputs.url }}