Skip to content

Commit 2a48c25

Browse files
committed
fix(ci): use comma-separated tags for nx container
- Fix nx-container plugin tag syntax (comma-separated, single --tags flag) - Simplify tag construction with PREFIX variable - Match nx-container plugin expected format
1 parent 1eb9b27 commit 2a48c25

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/build-push-images.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,12 @@ jobs:
153153
SHORT_SHA=$(echo $COMMIT_SHA | cut -c1-7)
154154
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
155155
REGISTRY="${{ steps.login-ecr.outputs.registry }}"
156+
PREFIX="${{ env.ECR_REGISTRY_PREFIX }}-${{ matrix.service }}"
156157
157-
# Build the image
158-
yarn nx container ${{ matrix.service }} \
159-
--tags ${REGISTRY}/${{ env.ECR_REGISTRY_PREFIX }}-${{ matrix.service }}:${SHORT_SHA} \
160-
--tags ${REGISTRY}/${{ env.ECR_REGISTRY_PREFIX }}-${{ matrix.service }}:latest \
161-
--tags ${REGISTRY}/${{ env.ECR_REGISTRY_PREFIX }}-${{ matrix.service }}:${TIMESTAMP} \
162-
--push=${{ github.event_name != 'pull_request' }}
158+
# Construct comma-separated list of tags
159+
TAGS="${REGISTRY}/${PREFIX}:${SHORT_SHA},${REGISTRY}/${PREFIX}:latest,${REGISTRY}/${PREFIX}:${TIMESTAMP}"
160+
161+
yarn nx container ${{ matrix.service }} --tags=$TAGS --push=${{ github.event_name != 'pull_request' }}
163162
164163
- name: Scan image for vulnerabilities
165164
if: github.event_name != 'pull_request'

0 commit comments

Comments
 (0)