-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
42 lines (42 loc) · 1.13 KB
/
cloudbuild.yaml
File metadata and controls
42 lines (42 loc) · 1.13 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
steps:
# 環境変数の設定
- name: node:16.15.0
entrypoint: yarn
args: [ "run", "create-env" ]
env:
- 'API_KEY=${_API_KEY}'
- 'SERVICE_DOMAIN=${_SERVICE_DOMAIN}'
# ビルド
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/blog:$COMMIT_SHA', '.']
# Container Registryにデプロイ
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/blog:$COMMIT_SHA']
# Cloud Runにデプロイ
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'blog'
# 誰でもアクセスできるように設定
- '--allow-unauthenticated'
- '--image'
- 'gcr.io/$PROJECT_ID/blog:$COMMIT_SHA'
- '--region'
- 'asia-northeast1'
# 最小起動インスタンスを設定
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'services'
- 'update'
- 'blog'
- '--min-instances'
- '1'
- '--region'
- 'asia-northeast1'
timeout: "1600s"
#images:
# - 'gcr.io/$PROJECT_ID/blog:$COMMIT_SHA'