Skip to content

Commit

Permalink
fix: update the image name and tag
Browse files Browse the repository at this point in the history
  • Loading branch information
lesterli committed Oct 19, 2024
1 parent 71084b1 commit 9b642a6
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/publish-bitcoin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
# Use docker.io for Docker Hub if empty
REGISTRY: docker.io
# Remove the slash at the end of the username
IMAGE_NAME: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}
IMAGE_NAME: ${{ secrets.DOCKER_HUB_USERNAME }}/bitcoind

jobs:
build:
Expand Down Expand Up @@ -62,9 +62,18 @@ jobs:
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern=v{{version}}
type=sha
- name: Set Docker image tag
id: set-tag
run: |
if [[ $GITHUB_REF == refs/pull/* ]]; then
echo "TAG=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/tags/* ]]; then
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
Expand All @@ -73,7 +82,7 @@ jobs:
with:
push: true
context: scripts/bitcoin
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.set-tag.outputs.TAG }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 9b642a6

Please sign in to comment.