Skip to content

test: use typed mocks #2158

test: use typed mocks

test: use typed mocks #2158

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@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
disable-sudo: true
policy: build
- name: 🚚 Check out the repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
persist-credentials: false
- name: 🤖 Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: 🏗️ Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: 🔑 Log in to Docker
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.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@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
id: meta
with:
images: ${{ github.repository }}
tags: |
type=edge
type=semver,pattern={{version}}
labels: |
io.artifacthub.package.license=Apache-2.0
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/favonia/cloudflare-ddns/main/build/SUMMARY.markdown
io.artifacthub.package.maintainers=[{"name":"favonia","email":"[email protected]"}]
- name: 🚀 Build and deploy minimal Docker images
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.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 }}
provenance: "mode=max"
- name: ✍️ Install Cosign
uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # 3.1.2
- name: ✍️ Sign the Docker images
if: ${{ github.event_name != 'pull_request' }}
run: |
cosign sign --recursive --yes "favonia/cloudflare-ddns@${{ steps.build.outputs.digest }}"