Skip to content

Merge branch 'linuxserver:master' into main #86

Merge branch 'linuxserver:master' into main

Merge branch 'linuxserver:master' into main #86

Workflow file for this run

name: Docker build and Push
on:
push:
paths-ignore:
- ".gihub/**"
pull_request:
paths-ignore:
- ".github/**"
workflow_dispatch:
jobs:
docker-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- name: linux/amd64
file: "Dockerfile"
- name: linux/arm64/v8
file: "Dockerfile.aarch64"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: thegreatestgiant/calibre
tags: |
${{ github.run_number }}
latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v4
with:
context: .
file: ${{ matrix.platform.file }}
platforms: ${{ matrix.platform.name }}
outputs: type=image,name=thegreatestgiant/calibre,push=true,digest=${{ steps.build.outputs.digest }}
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v3
with:
name: digests
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs:
- docker-build
steps:
- name: Download digests
uses: actions/download-artifact@v3
with:
name: digests
path: /tmp/digests
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: thegreatestgiant/calibre
tags: |
${{ github.run_number }}
latest
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'thegreatestgiant/calibre@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect thegreatestgiant/calibre:${{ steps.meta.outputs.version }}