2022-09-08 12:52:00 +02:00
|
|
|
name: Build container
|
|
|
|
description: Build and push a container
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
target:
|
|
|
|
required: true
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: composite
|
|
|
|
steps:
|
|
|
|
- uses: docker/metadata-action@v4
|
|
|
|
id: meta
|
|
|
|
with:
|
2022-09-14 20:31:19 +02:00
|
|
|
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ inputs.target }}
|
2022-09-14 21:30:25 +02:00
|
|
|
tags: |
|
|
|
|
type=ref,event=branch
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
2022-09-08 12:52:00 +02:00
|
|
|
|
2023-01-31 08:26:09 +01:00
|
|
|
- uses: docker/build-push-action@v4
|
2022-09-08 12:52:00 +02:00
|
|
|
with:
|
|
|
|
context: .
|
2022-09-14 20:31:19 +02:00
|
|
|
pull: true
|
|
|
|
push: ${{ github.event_name == 'push' }}
|
2022-09-21 14:40:53 +02:00
|
|
|
build-args: |
|
|
|
|
LIBRETIME_VERSION=${{ env.LIBRETIME_VERSION }}
|
2022-09-08 12:52:00 +02:00
|
|
|
target: ${{ inputs.target }}
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2022-09-14 20:31:19 +02:00
|
|
|
cache-from: type=gha,scope=${{ inputs.target }}
|
|
|
|
cache-to: type=gha,scope=${{ inputs.target }},mode=max
|