Skip to content

chore(deps-dev): bump the mix-dev group across 1 directory with 2 updates #212

chore(deps-dev): bump the mix-dev group across 1 directory with 2 updates

chore(deps-dev): bump the mix-dev group across 1 directory with 2 updates #212

Workflow file for this run

name: Docker
# 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:
#schedule:
# - cron: '16 5 * * *'
push:
branches: [ "master" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "master" ]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
env:
ELIXIR_VERSION: '1.15.7'
OTP_VERSION: '26.2.1'
DEBIAN_VERSION: 'bookworm-20231009-slim'
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- ubuntu-24.04-arm
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
uses: sigstore/cosign-installer@v3
with:
cosign-release: 'v2.2.3'
- name: Platform metadata
id: platform
run: |
case "${{ runner.arch }}" in
"X64")
echo "docker=linux/amd64" >> "$GITHUB_OUTPUT"
digest_name="digest-amd64"
;;
"ARM64")
echo "docker=linux/arm64" >> "$GITHUB_OUTPUT"
digest_name="digest-arm64"
;;
esac
echo "digest-name=${digest_name}" >> "$GITHUB_OUTPUT"
echo "digest-file=${digest_name}.txt" >> "$GITHUB_OUTPUT"
# 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
with:
version: latest
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5.6.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6.10.0
with:
context: .
provenance: false
platforms: ${{ steps.platform.outputs.docker }}
build-args: |
ERL_FLAGS=${{ env.ERL_FLAGS }}
ELIXIR_VERSION=${{ env.ELIXIR_VERSION }}
OTP_VERSION=${{ env.OTP_VERSION }}
DEBIAN_VERSION=${{ env.DEBIAN_VERSION }}
annotations: ${{ steps.meta.outputs.annotations }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,oci-mediatypes=true,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha
cache-to: type=gha,mode=max
# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: cosign sign --yes "${REGISTRY}/${IMAGE_NAME}@${DIGEST}"
- run: echo "${{ steps.build-and-push.outputs.digest }}" > ${{ steps.platform.outputs.digest-file }}
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.platform.outputs.digest-name }}
path: ${{ steps.platform.outputs.digest-file }}
merge:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
needs:
- build
steps:
- uses: actions/download-artifact@v4
with:
path: digests
pattern: digest-*
merge-multiple: true
- name: Get digests
id: digests
run: |
{
echo 'result<<EOF'
find digests -name 'digest-*.txt' -exec cat {} \;
echo 'EOF'
} >> "$GITHUB_OUTPUT"
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
uses: sigstore/cosign-installer@v3
with:
cosign-release: 'v2.2.3'
# 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
with:
version: latest
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5.6.1
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: index
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
#type=schedule
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
type=edge
type=ref,event=pr
type=sha,prefix=
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
id: imagetools
uses: kphrx/docker-buildx-imagetools-action@v0.1.2
with:
annotations: ${{ steps.meta.outputs.annotations }}
sources: ${{ steps.digests.outputs.result }}
tags: ${{ steps.meta.outputs.tags }}
# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.imagetools.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes "{}@${DIGEST}"