forked from libretime/libretime
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (89 loc) · 3.05 KB
/
container.yml
File metadata and controls
105 lines (89 loc) · 3.05 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
name: Container
on:
push:
tags: ["[0-9]+.[0-9]+.[0-9]+*"]
branches: [main, stable-*]
pull_request:
branches: [main, stable-*]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
meta:
runs-on: ubuntu-latest
strategy:
matrix:
target: [analyzer, api, legacy, nginx, playout, worker]
if: ${{ github.repository_owner == 'libretime' }}
steps:
- uses: actions/checkout@v5
- name: Update Docker Hub description
if: github.event_name == 'push'
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: libretime/libretime-${{ matrix.target }}
readme-filepath: ./README.md
- uses: docker/metadata-action@v5
id: meta
with:
bake-target: ${{ matrix.target }}
images: |
ghcr.io/libretime/libretime-${{ matrix.target }}
docker.io/libretime/libretime-${{ matrix.target }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Upload metadata bake file
uses: actions/upload-artifact@v4
with:
name: meta-${{ matrix.target }}
path: ${{ steps.meta.outputs.bake-file }}
build:
needs: [meta]
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'libretime' }}
steps:
- uses: actions/checkout@v5
- uses: docker/setup-buildx-action@v3
- name: Login ghcr.io
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login docker.io
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download all metadata bake files
uses: actions/download-artifact@v5
with:
pattern: meta-*
- name: Guess LIBRETIME_VERSION
run: |
make VERSION
echo "LIBRETIME_VERSION=$(cat VERSION | tr -d [:blank:])" >> $GITHUB_ENV
- name: Build
uses: docker/bake-action@v6
with:
source: .
pull: true
push: ${{ github.event_name == 'push' }}
files: |
docker-bake.json
meta-analyzer/docker-metadata-action-bake.json
meta-api/docker-metadata-action-bake.json
meta-legacy/docker-metadata-action-bake.json
meta-nginx/docker-metadata-action-bake.json
meta-playout/docker-metadata-action-bake.json
meta-worker/docker-metadata-action-bake.json
set: |
*.cache-from=type=gha,scope=container
*.cache-to=type=gha,scope=container,mode=max
*.args.LIBRETIME_VERSION=${{ env.LIBRETIME_VERSION }}