Skip to content

feat: Add Docker healthcheck support #3681

feat: Add Docker healthcheck support

feat: Add Docker healthcheck support #3681

Workflow file for this run

name: Docker
on:
push:
branches:
- main
pull_request:
release:
types: [published]
env:
platforms: "linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le,linux/riscv64,linux/s390x"
permissions:
contents: read
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-build-${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write
contents: read
steps:
- name: 🛡️ Harden Runner
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
with:
egress-policy: audit
disable-sudo: true
policy: build
- name: 🚚 Check out the repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: 🤖 Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: 🏗️ Set up Docker Buildx
uses: docker/setup-buildx-action@18ce135bb5112fa8ce4ed6c17ab05699d7f3a5e0 # v3.11.0
with:
version: latest
- name: 🔑 Log in to Docker
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: 🏷️ Fetch git tags for `git describe`
run: "git fetch --force --prune --unshallow --tags"
- name: 📝 Run `git describe` and save its output
run: echo 'GIT_DESCRIBE='`git describe --tags --always --long` >> $GITHUB_OUTPUT
id: git-describe
- name: 📝 Calculate metadata for minimal Docker images
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
id: meta
with:
images: ${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=edge
annotations: |
io.artifacthub.package.license=Apache-2.0 WITH LLVM-exception
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/favonia/cloudflare-ddns/main/build/SUMMARY.markdown
io.artifacthub.package.maintainers=[{"name":"favonia","email":"favonia@email.com"}]
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: index
- name: 🚀 Build and deploy minimal Docker images
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
id: build
with:
target: "minimal"
push: ${{ github.event_name != 'pull_request' }}
build-args: |
${{ format('GIT_DESCRIBE={0}', steps.git-describe.outputs.GIT_DESCRIBE) }}
platforms: ${{ env.platforms }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
provenance: "mode=max"
- name: ✍️ Install Cosign
uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
- name: ✍️ Sign the minimal Docker images
if: ${{ github.event_name == 'release' }}
run: |
cosign sign --recursive --yes "favonia/cloudflare-ddns@${{ steps.build.outputs.digest }}"
- name: 📝 Calculate metadata for Docker images with alpine
if: ${{ github.event_name != 'release' }}
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
id: meta-alpine
with:
images: ${{ github.repository }}
tags: |
type=edge,suffix=-alpine
annotations: |
io.artifacthub.package.license=Apache-2.0 WITH LLVM-exception
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/favonia/cloudflare-ddns/main/build/SUMMARY.markdown
io.artifacthub.package.maintainers=[{"name":"favonia","email":"favonia@email.com"}]
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: index
- name: 🚀 Build and deploy Docker images with alpine
if: ${{ github.event_name != 'release' }}
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
id: build-alpine
with:
target: "alpine"
push: ${{ github.event_name != 'pull_request' }}
build-args: |
${{ format('GIT_DESCRIBE={0}', steps.git-describe.outputs.GIT_DESCRIBE) }}
platforms: ${{ env.platforms }}
tags: ${{ steps.meta-alpine.outputs.tags }}
labels: ${{ steps.meta-alpine.outputs.labels }}
annotations: ${{ steps.meta-alpine.outputs.annotations }}
provenance: "mode=max"