From aaca54722a5fee9d912c7ebb288606ded22a354e Mon Sep 17 00:00:00 2001 From: sakkiii Date: Mon, 6 Sep 2021 10:32:37 +0530 Subject: [PATCH] version tag on docker hub --- .github/workflows/docker-release.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 85752a7..5820382 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -28,3 +28,25 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: awesometechnologies/synapse-admin:latest + - name: Calculate docker image tag + id: set-tag + run: | + case "${GITHUB_REF}" in + refs/heads/master|refs/heads/main) + tag=latest + ;; + refs/tags/*) + tag=${GITHUB_REF#refs/tags/} + ;; + *) + tag=${GITHUB_SHA} + ;; + esac + echo "::set-output name=tag::$tag" + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: "awesometechnologies/synapse-admin:${{ steps.set-tag.outputs.tag }}" + platforms: linux/amd64,linux/arm64