-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (47 loc) · 1.83 KB
/
build.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
53
54
55
56
name: Build app
on:
push:
branches:
- main
jobs:
build:
env:
PROJECT_ID: ${{ secrets.GCLOUD_PROJECT_ID }}
SERVICE_ACCOUNT_KEY: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_KEY }}
REGION: us-central1
runs-on: ubuntu-latest
steps:
- name: 'Check out code'
uses: actions/checkout@v4
- name: 'Install .NET'
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: 'Lint and Test'
run: |
make restore
make check
- name: 'GCloud Auth'
uses: google-github-actions/auth@v2
with:
project_id: ${{ env.PROJECT_ID }}
credentials_json: ${{ env.SERVICE_ACCOUNT_KEY }}
- name: 'Set up GCloud SDK'
uses: google-github-actions/setup-gcloud@v2
with:
version: '>= 363.0.0'
- name: 'Docker GCloud Auth'
run: |
gcloud auth configure-docker ${REGION}-docker.pkg.dev
- name: 'Build and deploy damo.io'
run: |
make damo.io.server.container
docker tag damo.io.server ${REGION}-docker.pkg.dev/${PROJECT_ID}/docker-images/damo.io.server:latest
docker push ${REGION}-docker.pkg.dev/${PROJECT_ID}/docker-images/damo.io.server:latest
gcloud run deploy damo-io-server --region ${REGION} --image ${REGION}-docker.pkg.dev/${PROJECT_ID}/docker-images/damo.io.server:latest
- name: 'Build and deploy blog.damo.io'
run: |
make damo.io.blog.container
docker tag damo.io.blog ${REGION}-docker.pkg.dev/${PROJECT_ID}/docker-images/damo.io.blog:latest
docker push ${REGION}-docker.pkg.dev/${PROJECT_ID}/docker-images/damo.io.blog:latest
gcloud run deploy damo-io-blog --region ${REGION} --image ${REGION}-docker.pkg.dev/${PROJECT_ID}/docker-images/damo.io.blog:latest