diff --git a/.changeset/sour-sheep-rush.md b/.changeset/sour-sheep-rush.md new file mode 100644 index 00000000000..eedcf20a516 --- /dev/null +++ b/.changeset/sour-sheep-rush.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": patch +--- + +Tag docker container as latest when the published GitHub release is marked as "latest" \ No newline at end of file diff --git a/.github/workflows/publish-containers.yml b/.github/workflows/publish-containers.yml index ac6ab7a7d02..dc91aaba13a 100644 --- a/.github/workflows/publish-containers.yml +++ b/.github/workflows/publish-containers.yml @@ -26,12 +26,21 @@ jobs: # Pre-releases, alphas, etc. as :snapshot - name: Output image tags from git tag events if: ${{ startsWith(github.ref, 'refs/tags/') }} + env: + GH_TOKEN: ${{ github.token }} run: | - # Remove everything else than the tagged version - DASHBOARD_VERSION=${GITHUB_REF#refs/tags/} + LATEST_VERSION=$(gh api repos/saleor/saleor-dashboard/releases/latest | jq -r .tag_name) + CURRENT_TAG=${GITHUB_REF#refs/tags/} + + if [ "$LATEST_VERSION" = "$CURRENT_TAG" ]; then + TAGS=${{ steps.image.outputs.image_name }}:${CURRENT_TAG},${{ steps.image.outputs.image_name }}:latest + else + TAGS=${{ steps.image.outputs.image_name }}:${CURRENT_TAG} + fi + echo " - DASHBOARD_VERSION=${DASHBOARD_VERSION} - CONTAINER_TAGS=${{ steps.image.outputs.image_name }}:${DASHBOARD_VERSION} + DASHBOARD_VERSION=${CURRENT_TAG} + CONTAINER_TAGS=${TAGS} " >> "${GITHUB_ENV}" - name: Set up Docker QEMU