Skip to content

Commit b36f8be

Browse files
fix(ci): adjust cloudbuild variable name substitution AGAIN
1 parent 96eb085 commit b36f8be

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/deploy-online-serverest.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ jobs:
5151
run: |
5252
gcloud builds submit . \
5353
--config=cloudbuild.yaml \
54-
--substitutions=_COMMIT_SHA=${{ github.sha }} \
55-
--substitutions=_VERSION=${{ github.ref_name }}
54+
--substitutions=COMMIT_SHA=${{ github.sha }},_VERSION=${{ github.ref_name }}
5655
5756
deploy-staging:
5857
name: Deploy on staging environment (staging.serverest.dev)

cloudbuild.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ steps:
44
- name: 'gcr.io/cloud-builders/docker'
55
args: ['build',
66
'--file', 'Dockerfile',
7-
'--tag', 'gcr.io/${_PROJECT_ID}/${_SERVICE_NAME}:${_COMMIT_SHA}',
7+
'--tag', 'gcr.io/${_PROJECT_ID}/${_SERVICE_NAME}:$COMMIT_SHA',
88
'--tag', 'gcr.io/${_PROJECT_ID}/${_SERVICE_NAME}:${_VERSION}',
9-
'--label', 'org.opencontainers.image.revision=${_COMMIT_SHA}',
9+
'--label', 'org.opencontainers.image.revision=$COMMIT_SHA',
1010
'--label', 'org.opencontainers.image.source=github.com/ServeRest/ServeRest',
1111
'.']
1212
# Push the container image to Container Registry
1313
- name: 'gcr.io/cloud-builders/docker'
14-
args: ['push', 'gcr.io/${_PROJECT_ID}/${_SERVICE_NAME}:${_COMMIT_SHA}']
14+
args: ['push', 'gcr.io/${_PROJECT_ID}/${_SERVICE_NAME}:$COMMIT_SHA']
1515
- name: 'gcr.io/cloud-builders/docker'
1616
args: ['push', 'gcr.io/${_PROJECT_ID}/${_SERVICE_NAME}:${_VERSION}']
1717
substitutions: # default values
1818
_PROJECT_ID: serverest
1919
_SERVICE_NAME: app
2020
images: [
21-
'gcr.io/${_PROJECT_ID}/${_SERVICE_NAME}:${_COMMIT_SHA}',
21+
'gcr.io/${_PROJECT_ID}/${_SERVICE_NAME}:$COMMIT_SHA',
2222
'gcr.io/${_PROJECT_ID}/${_SERVICE_NAME}:${_VERSION}'
2323
]

0 commit comments

Comments
 (0)