diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 329dc5e..ea5e896 100755 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -260,12 +260,28 @@ jobs: name: Publishing Docker image to Docker Hub runs-on: ubuntu-latest steps: - - name: Check out the repo - uses: actions/checkout@v2 - - name: Push to Docker Hub - uses: docker/build-push-action@v1 + - name: Get release artifacts + uses: actions/download-artifact@v2 + with: + name: artifacts + path: artifacts + + - name: Set release version + shell: bash + run: | + release_version="$(cat ./artifacts/release-version)" + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV + + - name: Validate release environment variables + run: | + echo "Release version: ${{ env.RELEASE_VERSION }}" + - name: Login to Docker Hub + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_TOKEN }} - repository: deepu105/jwt-ui - tag_with_ref: true + - name: Push to Docker Hub + uses: docker/build-push-action@v5 + with: + tags: deepu105/jwt-ui:latest, deepu105/jwt-ui:${{ env.RELEASE_VERSION }} + push: true