-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (61 loc) · 1.87 KB
/
build-containers.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
name: build-containers
on:
push:
# branches: [ main ]
# paths-ignore:
# - '**.adoc'
tags: [ 'v*' ]
pull_request:
workflow_dispatch:
concurrency:
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
cancel-in-progress: true
jobs:
build-containers:
name: ${{ matrix.container }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
container:
- 'centos-7-amd64'
- 'centos-9-amd64'
- 'fedora-39-amd64'
- 'fedora-40-amd64'
- 'debian-11-amd64'
- 'debian-11-i386'
- 'debian-12-amd64'
- 'debian-12-i386'
- 'opensuse-leap'
- 'opensuse-tumbleweed'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: rnpgp
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./${{ matrix.container }}.Dockerfile
push: ${{ contains(github.ref, 'refs/tags/v') }}
tags: ghcr.io/rnpgp/ci-rnp-${{ matrix.container }}
labels: |
latest
"org.opencontainers.image.source=${{ github.repositoryUrl }}"
- name: Purge old versions
if: contains(github.ref, 'refs/tags/v')
continue-on-error: true
uses: actions/delete-package-versions@v4
with:
package-name: 'ci-rnp-${{ matrix.container }}'
package-type: 'container'
min-versions-to-keep: 1
delete-only-untagged-versions: 'true'