Skip to content

Commit

Permalink
fix wrong docker image name (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu authored Aug 7, 2024
1 parent 5bf0b59 commit 9e92bc8
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,25 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine tags for Docker image
id: set-tags
run: |
echo "TAGS=${{ github.sha }}" >> $GITHUB_ENV
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
echo "TAGS=type=ref,event=tag" >> $GITHUB_ENV
fi
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
ghcr.io/${{ github.repository }}
- name: Build and push Docker images when push to main
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
if: github.ref == 'refs/heads/main'
with:
context: .
push: true
tags: ${{ steps.meta.outputs.images }}:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}
images: ghcr.io/${{ github.repository }}
tags: ${{ env.TAGS }}

- name: Build and push Docker images when release
- name: Build and push Docker images
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
if: startsWith(github.ref, 'refs/tags/v')
with:
context: .
push: true
tags: ${{ steps.meta.outputs.images }}:${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 9e92bc8

Please sign in to comment.