Skip to content

Fixes

Fixes #20

name: Build & Push
on: [ push ]
env:
# Pin the base version of traefik-forward-auth to download and include in final image
# https://github.com/thomseddon/traefik-forward-auth/releases
VERSION: 2.3.0
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build_and_push:
name: Build & Push image to registry
runs-on: ubuntu-24.04
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Buildx
uses: docker/[email protected]
- name: Login to the registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Configure metadata
id: meta
uses: docker/[email protected]
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: index
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},value=${{ env.VERSION }}
type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }}
type=semver,pattern={{major}},value=${{ env.VERSION }}
annotations: |
org.opencontainers.image.authors="Thom Seddon"
org.opencontainers.image.url=https://github.com/flokod/traefik-forward-auth
org.opencontainers.image.source=https://github.com/thomseddon/traefik-forward-auth
org.opencontainers.image.version=${{ env.VERSION }}
org.opencontainers.image.licenses=MIT
- name: Build and push Docker image
id: push
uses: docker/[email protected]
with:
platforms: linux/amd64,linux/arm
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
build-args: |
VERSION=${{ env.VERSION }}