90 lines
2.6 KiB
YAML
90 lines
2.6 KiB
YAML
name: Build & Publish to Docker Hub
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
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: ./${{ matrix.path }}Dockerfile
|
|
push: ${{ github.ref == 'refs/heads/main' }}
|
|
tags: |
|
|
jasongdove/ersatztv-ffmpeg:7.1.1${{ 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: ./${{ matrix.path }}Dockerfile
|
|
push: ${{ github.ref == 'refs/heads/main' }}
|
|
platforms: 'linux/arm64'
|
|
tags: |
|
|
jasongdove/ersatztv-ffmpeg:7.1.1${{ 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: ./${{ matrix.path }}Dockerfile
|
|
push: ${{ github.ref == 'refs/heads/main' }}
|
|
platforms: 'linux/arm/v7'
|
|
tags: |
|
|
jasongdove/ersatztv-ffmpeg:7.1.1${{ matrix.suffix }}
|
|
if: ${{ matrix.name == 'arm32v7' }}
|