File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 47
47
VERSION="${{ github.event.inputs.version }}"
48
48
fi
49
49
VERSION_LOWER=$(echo $VERSION | tr '[:upper:]' '[:lower:]')
50
- REPO_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
50
+ REPO_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') # Use full lowercase repo name for both GHCR and DockerHub
51
51
echo "VERSION=$VERSION_LOWER" >> $GITHUB_ENV
52
52
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
53
53
@@ -75,14 +75,14 @@ jobs:
75
75
- name : Build and Push Docker Image (DockerHub)
76
76
run : |
77
77
docker buildx build --platform linux/amd64,linux/arm64 \
78
- --tag ${{ secrets.DOCKERHUB_USER }}/your-image :${{ env.VERSION }} \
79
- --tag ${{ secrets.DOCKERHUB_USER }}/your-image :latest \
78
+ --tag ${{ env.REPO_NAME }}:${{ env.VERSION }} \
79
+ --tag ${{ env.REPO_NAME }}:latest \
80
80
--push .
81
81
82
82
- name : Retag and Push Previous Version (DockerHub)
83
83
if : env.PREV_VERSION != ''
84
84
run : |
85
- docker pull ${{ secrets.DOCKERHUB_USER }}/your-image :latest
86
- docker tag ${{ secrets.DOCKERHUB_USER }}/your-image :latest \
87
- ${{ secrets.DOCKERHUB_USER }}/your-image :${{ env.PREV_VERSION }}
88
- docker push ${{ secrets.DOCKERHUB_USER }}/your-image :${{ env.PREV_VERSION }}
85
+ docker pull ${{ env.REPO_NAME }}:latest
86
+ docker tag ${{ env.REPO_NAME }}:latest \
87
+ ${{ env.REPO_NAME }}:${{ env.PREV_VERSION }}
88
+ docker push ${{ env.REPO_NAME }}:${{ env.PREV_VERSION }}
You can’t perform that action at this time.
0 commit comments