mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
3.5 KiB
112 lines
3.5 KiB
name: Build & Publish to Docker Hub |
|
on: |
|
workflow_call: |
|
inputs: |
|
base_version: |
|
description: 'Base version (latest or develop)' |
|
required: true |
|
type: string |
|
info_version: |
|
description: 'Informational version number (e.g. 0.3.7-alpha)' |
|
required: true |
|
type: string |
|
tag_version: |
|
description: 'Docker tag version (e.g. v0.3.7)' |
|
required: true |
|
type: string |
|
secrets: |
|
docker_hub_username: |
|
required: true |
|
docker_hub_access_token: |
|
required: true |
|
jobs: |
|
build_and_push: |
|
name: Build & Publish |
|
runs-on: ubuntu-latest |
|
if: contains(github.event.head_commit.message, '[no build]') == false |
|
strategy: |
|
matrix: |
|
include: |
|
- name: base |
|
path: '' |
|
suffix: '' |
|
qemu: false |
|
- name: nvidia |
|
path: 'nvidia/' |
|
suffix: '-nvidia' |
|
qemu: false |
|
- name: vaapi |
|
path: 'vaapi/' |
|
suffix: '-vaapi' |
|
qemu: false |
|
- name: arm32v7 |
|
path: 'arm32v7/' |
|
suffix: '-arm' |
|
qemu: true |
|
- name: arm64 |
|
path: 'arm64/' |
|
suffix: '-arm64' |
|
qemu: true |
|
steps: |
|
- name: Checkout |
|
uses: actions/checkout@v4 |
|
with: |
|
fetch-depth: 0 |
|
|
|
- name: Set up QEMU |
|
uses: docker/setup-qemu-action@v3 |
|
if: ${{ matrix.qemu == true }} |
|
|
|
- name: Set up Docker Buildx |
|
uses: docker/setup-buildx-action@v3 |
|
id: docker-buildx |
|
|
|
- name: Login to DockerHub |
|
uses: docker/login-action@v3 |
|
with: |
|
username: ${{ secrets.docker_hub_username }} |
|
password: ${{ secrets.docker_hub_access_token }} |
|
|
|
- name: Build and push |
|
uses: docker/build-push-action@v5 |
|
with: |
|
builder: ${{ steps.docker-buildx.outputs.name }} |
|
context: . |
|
file: ./docker/${{ matrix.path }}Dockerfile |
|
push: true |
|
build-args: | |
|
INFO_VERSION=${{ inputs.info_version }}-docker${{ matrix.suffix }} |
|
tags: | |
|
jasongdove/ersatztv:${{ inputs.base_version }}${{ matrix.suffix }} |
|
jasongdove/ersatztv:${{ inputs.tag_version }}${{ matrix.suffix }} |
|
if: ${{ matrix.name != 'arm64' && matrix.name != 'arm32v7' }} |
|
|
|
- name: Build and push |
|
uses: docker/build-push-action@v5 |
|
with: |
|
builder: ${{ steps.docker-buildx.outputs.name }} |
|
context: . |
|
file: ./docker/${{ matrix.path }}Dockerfile |
|
push: true |
|
platforms: 'linux/arm64' |
|
build-args: | |
|
INFO_VERSION=${{ inputs.info_version }}-docker${{ matrix.suffix }} |
|
tags: | |
|
jasongdove/ersatztv:${{ inputs.base_version }}${{ matrix.suffix }} |
|
jasongdove/ersatztv:${{ inputs.tag_version }}${{ matrix.suffix }} |
|
if: ${{ matrix.name == 'arm64' }} |
|
|
|
- name: Build and push |
|
uses: docker/build-push-action@v5 |
|
with: |
|
builder: ${{ steps.docker-buildx.outputs.name }} |
|
context: . |
|
file: ./docker/${{ matrix.path }}Dockerfile |
|
push: true |
|
platforms: 'linux/arm/v7' |
|
build-args: | |
|
INFO_VERSION=${{ inputs.info_version }}-docker${{ matrix.suffix }} |
|
tags: | |
|
jasongdove/ersatztv:${{ inputs.base_version }}${{ matrix.suffix }} |
|
jasongdove/ersatztv:${{ inputs.tag_version }}${{ matrix.suffix }} |
|
if: ${{ matrix.name == 'arm32v7' }}
|
|
|