debian-nightly-master #25
This file contains hidden or 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: debian-nightly-master | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
push: | |
paths: | |
- 'master/Dockerfile' | |
- 'master/docker-entrypoint.sh' | |
env: | |
CONTEXT: master | |
REGISTRY_IMAGE: bitcoin/bitcoin | |
TAGS: master | |
TEST_TAG: master-test | |
jobs: | |
build: | |
runs-on: ${{ matrix.platform.github }} | |
strategy: | |
matrix: | |
platform: | |
- github: ubuntu-24.04 | |
docker: linux/amd64 | |
- github: ubuntu-24.04-arm | |
docker: linux/arm64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Prepare | |
run: | | |
platform=${{ matrix.platform.docker }} | |
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY_IMAGE }} | |
tags: type=raw,value=${{ env.TAGS }} | |
- name: Login into Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: bitcoin | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
create-symlink: true | |
- name: Build and export to Docker | |
uses: docker/build-push-action@v6 | |
with: | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
context: ${{ env.CONTEXT }} | |
load: true | |
tags: ${{ env.TEST_TAG }} | |
- name: Test | |
run: | | |
docker run --rm ${{ env.TEST_TAG }} bitcoind --version | |
- name: Build and push Docker image | |
id: build | |
uses: docker/build-push-action@v6 | |
with: | |
context: ${{ env.CONTEXT }} | |
platforms: ${{ matrix.platform.docker }} | |
push: ${{ github.event_name == 'schedule' }} | |
labels: ${{ steps.meta.outputs.labels }} | |
tags: ${{ env.REGISTRY_IMAGE }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-args: | | |
BUILD_DATE=${{ github.event.repository.updated_at }} | |
VCS_REF=${{ github.sha }} | |
outputs: type=image,push-by-digest=true,name-canonical=true | |
- name: Export digest | |
run: | | |
mkdir -p ${{ runner.temp }}/digests | |
digest="${{ steps.build.outputs.digest }}" | |
touch "${{ runner.temp }}/digests/${digest#sha256:}" | |
- name: Upload digest | |
uses: actions/upload-artifact@v4 | |
with: | |
name: digests-${{ env.PLATFORM_PAIR }} | |
path: ${{ runner.temp }}/digests/* | |
if-no-files-found: error | |
retention-days: 1 | |
merge: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Download digests | |
uses: actions/download-artifact@v4 | |
with: | |
path: ${{ runner.temp }}/digests | |
pattern: digests-* | |
merge-multiple: true | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: bitcoin | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY_IMAGE }} | |
tags: | | |
type=raw,value=${{ env.TAGS }} | |
- name: Create manifest list and push | |
if: github.event_name == 'schedule' | |
working-directory: ${{ runner.temp }}/digests | |
run: | | |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | |
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) | |
- name: Test bitcoind (pulled image) | |
if: github.event_name == 'schedule' | |
run: | | |
docker run --rm ${{ env.REGISTRY_IMAGE }}:${{ env.TAGS }} bitcoind --version | |
- name: Inspect image | |
run: | | |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} |