-
Notifications
You must be signed in to change notification settings - Fork 12
91 lines (77 loc) · 2.39 KB
/
container.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
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Container
on:
push:
branches: [main]
paths:
- .github/workflows/container.yml
- alpine.dockerfile
- debian.dockerfile
- docker-entrypoint.sh
- Makefile
- SHA512SUMS.txt
- xml-edit.sh
pull_request:
branches: [main]
paths:
- .github/workflows/container.yml
- alpine.dockerfile
- debian.dockerfile
- docker-entrypoint.sh
- Makefile
- SHA512SUMS.txt
- xml-edit.sh
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- 2.4.4
- 2.5-beta3
variant:
- debian
- alpine
env:
DEFAULT_VARIANT: debian
DEFAULT_VERSION: 2.4.4
if: ${{ github.repository_owner == 'libretime' }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/login-action@v3
if: github.event_name == 'push'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: make icecast-${{ matrix.version }}.tar.gz
- uses: docker/metadata-action@v5
id: meta
with:
images: |
ghcr.io/${{ github.repository_owner }}/icecast
${{ github.repository_owner }}/icecast
tags: |
type=raw,value=${{ matrix.version }}-${{ matrix.variant }}
type=raw,value=${{ matrix.version }},enable=${{ matrix.variant == env.DEFAULT_VARIANT }}
type=raw,value=${{ matrix.variant }},enable=${{ matrix.version == env.DEFAULT_VERSION }}
type=raw,value=latest,enable=${{ matrix.variant == env.DEFAULT_VARIANT && matrix.version == env.DEFAULT_VERSION }}
- uses: docker/build-push-action@v6
with:
context: .
pull: true
file: ${{ matrix.variant }}.dockerfile
build-args: |
VERSION=${{ matrix.version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'push' }}