From 0ea3c1ab5cde4eaec6f9b127023229af6dfb10e7 Mon Sep 17 00:00:00 2001 From: Souradip Mookerjee Date: Thu, 7 Apr 2022 13:37:23 +0100 Subject: [PATCH] Update docker-image.yml --- .github/workflows/docker-image.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 853f39f..6527df8 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -30,9 +30,11 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + - name: 'Get Previous tag' + id: previoustag + uses: "WyriHaximus/github-action-get-previous-tag@v1" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - name: Build image and push to Docker Hub and GitHub Container Registry uses: docker/build-push-action@v2 @@ -40,9 +42,9 @@ jobs: context: . tags: | caroga/commentoplusplus:latest - caroga/commentoplusplus:"${{ steps.date.outputs.date }}" + caroga/commentoplusplus:"${{ steps.previoustag.outputs.tag }}" ghcr.io/souramoo/commentoplusplus:latest - ghcr.io/souramoo/commentoplusplus:"${{ steps.date.outputs.date }}" + ghcr.io/souramoo/commentoplusplus:"${{ steps.previoustag.outputs.tag }}" # build on feature branches, push only on main branch push: ${{ github.ref == 'refs/heads/main' }} platforms: amd64,arm,arm64,riscv64