Skip to content

Commit

Permalink
docker-publish-fix6
Browse files Browse the repository at this point in the history
  • Loading branch information
Slingexe authored Feb 4, 2025
1 parent ed9694b commit 402abb6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
VERSION="${{ github.event.inputs.version }}"
fi
VERSION_LOWER=$(echo $VERSION | tr '[:upper:]' '[:lower:]')
REPO_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
REPO_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') # Use full lowercase repo name for both GHCR and DockerHub
echo "VERSION=$VERSION_LOWER" >> $GITHUB_ENV
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
Expand Down Expand Up @@ -75,14 +75,14 @@ jobs:
- name: Build and Push Docker Image (DockerHub)
run: |
docker buildx build --platform linux/amd64,linux/arm64 \
--tag ${{ secrets.DOCKERHUB_USER }}/your-image:${{ env.VERSION }} \
--tag ${{ secrets.DOCKERHUB_USER }}/your-image:latest \
--tag ${{ env.REPO_NAME }}:${{ env.VERSION }} \
--tag ${{ env.REPO_NAME }}:latest \
--push .
- name: Retag and Push Previous Version (DockerHub)
if: env.PREV_VERSION != ''
run: |
docker pull ${{ secrets.DOCKERHUB_USER }}/your-image:latest
docker tag ${{ secrets.DOCKERHUB_USER }}/your-image:latest \
${{ secrets.DOCKERHUB_USER }}/your-image:${{ env.PREV_VERSION }}
docker push ${{ secrets.DOCKERHUB_USER }}/your-image:${{ env.PREV_VERSION }}
docker pull ${{ env.REPO_NAME }}:latest
docker tag ${{ env.REPO_NAME }}:latest \
${{ env.REPO_NAME }}:${{ env.PREV_VERSION }}
docker push ${{ env.REPO_NAME }}:${{ env.PREV_VERSION }}

0 comments on commit 402abb6

Please sign in to comment.