2022-09-08 12:52:00 +02:00
|
|
|
name: Container
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags: ["[0-9]+.[0-9]+.[0-9]+*"]
|
2024-01-13 12:50:51 +01:00
|
|
|
branches: [main, stable-*]
|
2022-09-08 12:52:00 +02:00
|
|
|
pull_request:
|
2024-01-13 12:50:51 +01:00
|
|
|
branches: [main, stable-*]
|
2022-09-08 12:52:00 +02:00
|
|
|
|
2022-09-14 20:31:42 +02:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
|
2022-09-08 12:52:00 +02:00
|
|
|
jobs:
|
2023-02-26 15:18:10 +01:00
|
|
|
meta:
|
2022-09-08 12:52:00 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2023-02-26 15:18:10 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
target: [analyzer, api, legacy, playout, worker]
|
|
|
|
|
|
|
|
if: ${{ github.repository_owner == 'libretime' }}
|
|
|
|
steps:
|
2023-10-21 21:30:18 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-26 15:18:10 +01:00
|
|
|
|
2023-03-02 13:49:20 +01:00
|
|
|
- name: Update Docker Hub description
|
|
|
|
if: github.event_name == 'push'
|
2024-01-30 18:22:28 +01:00
|
|
|
uses: peter-evans/dockerhub-description@v4
|
2023-03-02 13:49:20 +01:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
repository: libretime/libretime-${{ matrix.target }}
|
|
|
|
readme-filepath: ./README.md
|
|
|
|
|
2024-02-01 17:23:04 +01:00
|
|
|
- uses: docker/metadata-action@v5
|
2023-02-26 15:18:10 +01:00
|
|
|
id: meta
|
|
|
|
with:
|
|
|
|
bake-target: ${{ matrix.target }}
|
|
|
|
images: |
|
|
|
|
ghcr.io/libretime/libretime-${{ matrix.target }}
|
2023-02-26 15:34:14 +01:00
|
|
|
docker.io/libretime/libretime-${{ matrix.target }}
|
2023-02-26 15:18:10 +01:00
|
|
|
tags: |
|
|
|
|
type=ref,event=branch
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
|
|
|
|
- name: Upload metadata bake file
|
2023-12-22 18:23:56 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-02-26 15:18:10 +01:00
|
|
|
with:
|
|
|
|
name: meta-${{ matrix.target }}
|
|
|
|
path: ${{ steps.meta.outputs.bake-file }}
|
|
|
|
|
|
|
|
build:
|
|
|
|
needs: [meta]
|
|
|
|
runs-on: ubuntu-latest
|
2022-09-08 12:52:00 +02:00
|
|
|
|
|
|
|
if: ${{ github.repository_owner == 'libretime' }}
|
|
|
|
steps:
|
2023-10-21 21:30:18 +02:00
|
|
|
- uses: actions/checkout@v4
|
2022-09-08 12:52:00 +02:00
|
|
|
|
2023-09-12 19:59:14 +02:00
|
|
|
- uses: docker/setup-buildx-action@v3
|
2022-09-14 20:31:19 +02:00
|
|
|
|
2023-02-26 15:18:10 +01:00
|
|
|
- name: Login ghcr.io
|
|
|
|
if: github.event_name == 'push'
|
2023-09-13 12:12:00 +02:00
|
|
|
uses: docker/login-action@v3
|
2022-09-08 12:52:00 +02:00
|
|
|
with:
|
2023-02-26 15:18:10 +01:00
|
|
|
registry: ghcr.io
|
2022-09-08 12:52:00 +02:00
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-02-26 15:34:14 +01:00
|
|
|
- name: Login docker.io
|
|
|
|
if: github.event_name == 'push'
|
2023-09-13 12:12:00 +02:00
|
|
|
uses: docker/login-action@v3
|
2023-02-26 15:34:14 +01:00
|
|
|
with:
|
|
|
|
registry: docker.io
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2023-02-26 15:18:10 +01:00
|
|
|
- name: Download all metadata bake files
|
2023-12-22 18:23:56 +01:00
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
pattern: meta-*
|
2023-02-26 15:18:10 +01:00
|
|
|
|
2022-09-21 14:40:53 +02:00
|
|
|
- name: Guess LIBRETIME_VERSION
|
|
|
|
run: |
|
|
|
|
make VERSION
|
|
|
|
echo "LIBRETIME_VERSION=$(cat VERSION | tr -d [:blank:])" >> $GITHUB_ENV
|
|
|
|
|
2023-02-26 15:18:10 +01:00
|
|
|
- name: Build
|
2024-06-18 10:19:39 +02:00
|
|
|
uses: docker/bake-action@v5
|
2022-09-14 20:31:19 +02:00
|
|
|
with:
|
|
|
|
pull: true
|
2023-02-26 15:18:10 +01:00
|
|
|
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-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 }}
|