-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (67 loc) · 2.7 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
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build & Push traefik-forward-auth image
on: [ push ]
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
# https://github.com/thomseddon/traefik-forward-auth/releases
# https://github.com/n8n-io/n8n/releases
VERSION: 2.3.0
jobs:
push_to_registry:
name: Build & Push image to registry
runs-on: ubuntu-22.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 GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
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.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 }}
labels: |
org.opencontainers.image.title=traefik-forward-auth
org.opencontainers.image.description="Minimal forward authentication service that provides Google/OpenID oauth based login and authentication for the traefik reverse proxy"
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
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
# See https://github.com/docker/build-push-action/issues/900#issuecomment-1625431663
provenance: false
build-args: |
VERSION=${{ env.VERSION }}
- name: Push to ghcr.io
run: docker push -a ${{ env.IMAGE_NAME }}
# - name: Generate artifact attestation
# uses: actions/[email protected]
# with:
# subject-name: ${{ env.IMAGE_NAME}}
# subject-digest: ${{ steps.push.outputs.digest }}
# push-to-registry: true