ci: add containers build job
This commit is contained in:
parent
1da42b2603
commit
b93e24a02c
|
@ -0,0 +1,24 @@
|
||||||
|
name: Build container
|
||||||
|
description: Build and push a container
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
required: true
|
||||||
|
images:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- uses: docker/metadata-action@v4
|
||||||
|
id: meta
|
||||||
|
with:
|
||||||
|
images: ${{ inputs.images }}
|
||||||
|
|
||||||
|
- uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: ${{ startsWith(github.ref, 'refs/tags') }}
|
||||||
|
target: ${{ inputs.target }}
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
|
@ -0,0 +1,56 @@
|
||||||
|
name: Container
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ["[0-9]+.[0-9]+.[0-9]+*"]
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
NAMESPACE: ${{ github.repository_owner }}
|
||||||
|
|
||||||
|
if: ${{ github.repository_owner == 'libretime' }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build libretime-analyzer
|
||||||
|
uses: ./.github/workflows/actions/build-container
|
||||||
|
with:
|
||||||
|
target: libretime-analyzer
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/libretime-analyzer
|
||||||
|
|
||||||
|
- name: Build libretime-api
|
||||||
|
uses: ./.github/workflows/actions/build-container
|
||||||
|
with:
|
||||||
|
target: libretime-api
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/libretime-api
|
||||||
|
|
||||||
|
- name: Build libretime-playout
|
||||||
|
uses: ./.github/workflows/actions/build-container
|
||||||
|
with:
|
||||||
|
target: libretime-playout
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/libretime-playout
|
||||||
|
|
||||||
|
- name: Build libretime-worker
|
||||||
|
uses: ./.github/workflows/actions/build-container
|
||||||
|
with:
|
||||||
|
target: libretime-worker
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/libretime-worker
|
||||||
|
|
||||||
|
- name: Build libretime-legacy
|
||||||
|
uses: ./.github/workflows/actions/build-container
|
||||||
|
with:
|
||||||
|
target: libretime-legacy
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/libretime-legacy
|
Loading…
Reference in New Issue