Skip to content

Commit

Permalink
Add package version check to frontend release
Browse files Browse the repository at this point in the history
  • Loading branch information
limemloh committed Nov 6, 2024
1 parent 382f8e2 commit 6b2a8b0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/frontend-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ jobs:
flavor: latest=false
images: concordium/ccdscan-frontend
tags: type=match,pattern=frontend/(.*),group=1
- name: Ensure tag matches version in package.json
working-directory: frontend
run: |
PACKAGE_VERSION=$(jq -r .version package.json)
EXPECTED_TAG="concordium/ccdscan-frontend:$PACKAGE_VERSION"
EXTRACTED_TAG=${{ steps.meta.outputs.tag }}
if [ "$EXPECTED_TAG" = "$EXTRACTED_TAG" ]; then
printf "Extracted tag matches the version in package.json ($EXTRACTED_TAG).\n"
exit 0
else
printf "ERROR: Extracted tag does not match the expected derived from the version in package.json. \nExtracted: '$EXTRACTED_TAG'\nExpected: '$EXPECTED_TAG'\n"
exit 1
fi
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -31,7 +44,7 @@ jobs:
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
push: false
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tag }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 6b2a8b0

Please sign in to comment.