This repository was archived by the owner on Mar 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (67 loc) · 2.38 KB
/
publish-release-synapse-module.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
# This pipeline runs for every new tag. It will pull the docker container for
# the commit hash of the tag, and will publish it as `:<tag-name>` and `latest`.
name: Release Synapse Guest Module
on:
push:
tags:
- '@nordeck/synapse-guest-module@*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
packages: write
id-token: write
env:
DOCKER_IMAGE: ghcr.io/nordeck/synapse-guest-module
steps:
- name: Generate Docker metadata of the existing image
id: meta-existing-tag
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=sha,prefix=
- name: Generate Docker metadata of the new image
id: meta-new-tags
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE }}
labels: |
org.opencontainers.image.title=Synapse Guest Module
org.opencontainers.image.description=A synapse module to restrict the actions of guests
org.opencontainers.image.vendor=Nordeck IT + Consulting GmbH
tags: |
type=match,pattern=@nordeck/synapse-guest-module@(.*),group=1
- name: Generate Dockerfile
env:
SOURCE_IMAGE: ${{ fromJSON(steps.meta-existing-tag.outputs.json).tags[0] }}
run: |
echo "FROM $SOURCE_IMAGE" > Dockerfile
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Cosign
uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # @v3.8.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
id: build_and_push
uses: docker/build-push-action@v6
with:
push: true
context: .
tags: ${{ steps.meta-new-tags.outputs.tags }}
labels: ${{ steps.meta-new-tags.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/s390x
sbom: true
provenance: true
- name: Sign the images with GitHub OIDC Token
env:
DIGEST: ${{ steps.build_and_push.outputs.digest }}
run: cosign sign --yes "${DOCKER_IMAGE}@${DIGEST}"