-
Notifications
You must be signed in to change notification settings - Fork 7
52 lines (44 loc) · 1.35 KB
/
app.console.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
47
48
49
50
51
52
name: app.console
on:
push:
branches: [production]
paths:
- 'projects/app/console/**'
- '!projects/app/console/.env.development'
workflow_dispatch:
env:
PROJECT_ID: ${{ secrets.GCP_PROJECT }}
GCP_REGION: us-west1
SERVICE_NAME: speechy-app-console
PORT: 4002
SOURCE: app-console
jobs:
setup-build-deploy:
name: Setup, Build, and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# Setup gcloud CLI
- name: Setup
uses: google-github-actions/setup-gcloud@v0
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
project_id: ${{ secrets.GCP_PROJECT }}
export_default_credentials: true
- name: Authorize Docker push
run: gcloud auth configure-docker
- name: Build and Push Container
run: |-
docker build -t "gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA" -f ./_$SOURCE.Dockerfile .
docker push "gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA"
# Deploy image to Cloud Run
- name: Deploy
run: |-
gcloud run deploy "$SERVICE_NAME" \
--quiet \
--region "$GCP_REGION" \
--image "gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA" \
--platform "managed" \
--allow-unauthenticated \
--port=$PORT