From 88bc7da8e5cd1567deb25d4c66d707dd920079cf Mon Sep 17 00:00:00 2001 From: AgustinSRG Date: Tue, 17 Oct 2023 20:13:30 +0200 Subject: [PATCH] Fix docker-image workflow GITHUB_REF_NAME no longer working --- .github/workflows/docker-image.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 583605a2..ceefe3a0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,6 +13,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Set env RELEASE_VERSION + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Install NodeJS uses: actions/setup-node@v3 with: @@ -32,10 +35,10 @@ jobs: password: ${{ secrets.DOCKER_TOKEN }} - name: Add version tag to Docker image - run: docker tag asanrom/pmv:latest asanrom/pmv:$GITHUB_REF_NAME + run: docker tag asanrom/pmv:latest asanrom/pmv:${{ env.RELEASE_VERSION }} - name: Push the Docker image (Current Version) - run: docker push asanrom/pmv:$GITHUB_REF_NAME + run: docker push asanrom/pmv:${{ env.RELEASE_VERSION }} - name: Push the Docker image (Latest) run: docker push asanrom/pmv:latest @@ -48,13 +51,13 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Tag version (GitHub Packages) - run: docker tag asanrom/pmv:latest ghcr.io/agustinsrg/personalmediavault:$GITHUB_REF_NAME + run: docker tag asanrom/pmv:latest ghcr.io/agustinsrg/personalmediavault:${{ env.RELEASE_VERSION }} - name: Tag latest (GitHub Packages) run: docker tag asanrom/pmv:latest ghcr.io/agustinsrg/personalmediavault:latest - name: Push the Docker image (GitHub Packages) (Current Version) - run: docker push ghcr.io/agustinsrg/personalmediavault:$GITHUB_REF_NAME + run: docker push ghcr.io/agustinsrg/personalmediavault:${{ env.RELEASE_VERSION }} - name: Push the Docker image (GitHub Packages) (Latest) run: docker push ghcr.io/agustinsrg/personalmediavault:latest