Skip to content

Commit ce1be24

Browse files
committed
use sha in image tage
1 parent 9a0a428 commit ce1be24

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ jobs:
136136
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
137137
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
138138
TAG_LATEST: true
139+
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
139140
secrets:
140141
CDK_PUSH_IMAGE_ROLE: ${{ secrets.DEV_CDK_PUSH_IMAGE_ROLE }}
141142

@@ -153,6 +154,7 @@ jobs:
153154
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
154155
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
155156
TAG_LATEST: true
157+
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
156158
secrets:
157159
CDK_PUSH_IMAGE_ROLE: ${{ secrets.QA_CDK_PUSH_IMAGE_ROLE }}
158160

@@ -170,6 +172,7 @@ jobs:
170172
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
171173
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
172174
TAG_LATEST: true
175+
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
173176
secrets:
174177
CDK_PUSH_IMAGE_ROLE: ${{ secrets.REF_CDK_PUSH_IMAGE_ROLE }}
175178

@@ -187,6 +190,7 @@ jobs:
187190
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
188191
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
189192
TAG_LATEST: true
193+
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
190194
secrets:
191195
CDK_PUSH_IMAGE_ROLE: ${{ secrets.INT_CDK_PUSH_IMAGE_ROLE }}
192196

@@ -204,5 +208,6 @@ jobs:
204208
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
205209
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
206210
TAG_LATEST: true
211+
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
207212
secrets:
208213
CDK_PUSH_IMAGE_ROLE: ${{ secrets.PROD_CDK_PUSH_IMAGE_ROLE }}

.github/workflows/docker_image_upload.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
TAG_LATEST:
1616
required: true
1717
type: boolean
18+
DOCKER_IMAGE_TAG:
19+
required: true
20+
type: string
1821
secrets:
1922
CDK_PUSH_IMAGE_ROLE:
2023
required: true

.github/workflows/pull_request.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ jobs:
4646
runs-on: ubuntu-22.04
4747
outputs:
4848
commit_id: ${{ steps.commit_id.outputs.commit_id }}
49+
sha_short: ${{ steps.commit_id.outputs.sha_short }}
4950
steps:
5051
- name: Get Commit ID
5152
id: commit_id
5253
run: |
5354
echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT"
55+
echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
5456
5557
package_code:
5658
needs: [get_issue_number, quality_checks, get_commit_id]
@@ -67,5 +69,6 @@ jobs:
6769
VERSION_NUMBER: PR-${{ needs.get_issue_number.outputs.issue_number }}
6870
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
6971
TAG_LATEST: false
72+
DOCKER_IMAGE_TAG: PR-${{ needs.get_issue_number.outputs.issue_number }}-${{ needs.get_commit_id.outputs.sha_short }}
7073
secrets:
7174
CDK_PUSH_IMAGE_ROLE: ${{ secrets.DEV_CDK_PUSH_IMAGE_ROLE }}

0 commit comments

Comments
 (0)