-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 2.04 KB
/
build_and_publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build & Push
on:
workflow_dispatch:
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 }}