docs #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish-bitcoin | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
on: | |
push: | |
paths: | |
- 'scripts/bitcoin/**' | |
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 }}/bitcoind | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Set up QEMU for multi-architecture support | |
# https://github.com/docker/setup-qemu-action | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
# Set up BuildKit Docker container builder to be able to build | |
# multi-platform images and export cache | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# Login against a Docker registry | |
# https://github.com/docker/login-action | |
- name: Log into Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Set Docker image tag | |
id: set-tag | |
run: | | |
echo "TAG=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
# 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 | |
id: build-and-push | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
context: scripts/bitcoin | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.set-tag.outputs.TAG }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |