-
Notifications
You must be signed in to change notification settings - Fork 2
/
cloudbuild.yaml
30 lines (24 loc) · 1.35 KB
/
cloudbuild.yaml
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
steps:
# build the container image
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: [
'-c',
'docker build -t gcr.io/$PROJECT_ID/tibiawikiapi -f ./docker/Dockerfile --build-arg GITHUB_TOKEN=$$GITHUB_TOKEN .'
]
secretEnv: ['GITHUB_TOKEN']
# push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/tibiawikiapi-246008/tibiawikiapi']
# Deploy container image to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args: ['run', 'deploy', 'tibiawikiapi', '--image', 'gcr.io/tibiawikiapi-246008/tibiawikiapi', '--region', 'europe-west1', '--platform', 'managed', '--memory', '1Gi', '--project', 'tibiawikiapi-246008', '--update-env-vars', 'LOGGING_JSON=true', '--quiet']
# Serve traffic from new revision
- name: 'gcr.io/cloud-builders/gcloud'
args: ['alpha', 'run', 'services', 'update-traffic', 'tibiawikiapi', '--region', 'europe-west1', '--platform', 'managed', '--to-latest']
images:
- gcr.io/tibiawikiapi-246008/tibiawikiapi
secrets:
- kmsKeyName: projects/tibiawikiapi-246008/locations/global/keyRings/my-secrets/cryptoKeys/github-token
secretEnv:
GITHUB_TOKEN: CiQA5BHiVau0r93/go0GclWewjQvi10erqEHGi7nG5CHJpJudLwSUgAVCO4xq1IpCWVcMlDAM8Hg87XsjBcSojA7bS8W+gMGT43KLQNAf+1aj6qnjJ+l+Z6mST8nIGQW6bONZ014xy5SlW681SdgKUo6CoyVfAeyBf4=