-
Notifications
You must be signed in to change notification settings - Fork 1.5k
119 lines (106 loc) · 3.31 KB
/
container.yml
File metadata and controls
119 lines (106 loc) · 3.31 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Container
on:
push:
paths-ignore:
- '.devcontainer/**'
- 'lib/**'
- 'man/**'
- 'priv/**'
- '**.md'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-24.04${{ matrix.suffix }}
strategy:
matrix:
platform: [amd64, arm64]
include:
- platform: amd64
suffix:
- platform: arm64
suffix: -arm
permissions:
packages: write
steps:
- name: Check out repository code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Checkout ejabberd-contrib
uses: actions/checkout@v6
with:
repository: processone/ejabberd-contrib
path: .ejabberd-modules/sources/ejabberd-contrib
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get git describe
id: gitdescribe
run: echo "ver=$(git describe --tags)" >> $GITHUB_OUTPUT
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: suffix=--${{ matrix.platform }}
labels: |
org.opencontainers.image.revision=${{ steps.gitdescribe.outputs.ver }}
org.opencontainers.image.licenses=GPL-2.0
org.opencontainers.image.vendor=ProcessOne
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
build-args: |
VERSION=${{ steps.gitdescribe.outputs.ver }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: .github/container/Dockerfile
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/${{ matrix.platform }}
push: true
tags: ${{ steps.meta.outputs.tags }}
merge:
needs: [build]
runs-on: ubuntu-24.04
outputs:
image-uri: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.merge.outputs.digest }}
steps:
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta-amd
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: suffix=--amd64
- uses: docker/metadata-action@v5
id: meta-arm
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: suffix=--arm64
- uses: docker/metadata-action@v5
id: meta-result
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- uses: int128/docker-manifest-create-action@v2
id: merge
with:
index-annotations: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.meta-result.outputs.tags }}
sources: |
${{ steps.meta-amd.outputs.tags }}
${{ steps.meta-arm.outputs.tags }}
- uses: dataaxiom/ghcr-cleanup-action@v1
with:
dry-run: true
delete-tags: '*--a??64'
delete-untagged: true
delete-ghost-images: true
delete-partial-images: true
delete-orphaned-images: true