-
Notifications
You must be signed in to change notification settings - Fork 26
36 lines (27 loc) · 974 Bytes
/
deploy.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
name: Deploy
on:
push:
branches:
- main
env:
SERVICE_NAME: sigconverter
IMAGE_NAME: sigconverter.io
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Google Cloud SDK
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.PROJECT_ID }}
service_account_key: ${{ secrets.GCLOUD_AUTH }}
- name: Configure Docker
run: gcloud auth configure-docker
- name: Build Docker image
run: docker build -t ${{ env.IMAGE_NAME }} .
- name: Push Docker image to Google Container Registry
run: gcloud builds submit --tag gcr.io/${{ secrets.PROJECT_ID }}/${{ env.IMAGE_NAME }}
- name: Deploy to Google Cloud Run
run: gcloud run deploy ${{ env.SERVICE_NAME }} --image gcr.io/${{ secrets.PROJECT_ID }}/${{ env.IMAGE_NAME }} --platform managed --region us-central1