Files
ersatztv-ffmpeg/.github/workflows/multi-platform.yml
Jason Dove b5b7884794 compile ffmpeg against cuda 11.8 (#32)
* compile ffmpeg against cuda 11.8

* fix cuda download

* better fix

* try to fix cuda 11.8 install

* try not to mess up gcc

* try to fix alternatives

* one more try at fixing gcc

* try installing cuda with system gcc

* clean up cuda installer

* try to free disk space in build
2025-07-30 20:26:02 +00:00

133 lines
4.0 KiB
YAML

name: Docker Publish Multi-Platform
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/ersatztv/ersatztv-ffmpeg
RELEASE_VERSION: 7.1.1
jobs:
build:
name: Build Docker Images
runs-on: ${{ matrix.os }}
if: contains(github.event.head_commit.message, '[no build]') == false
strategy:
fail-fast: false
matrix:
include:
- name: amd64
platform: linux/amd64
os: ubuntu-latest
- name: arm64
platform: linux/arm64
os: ubuntu-24.04-arm
- name: arm32v7
platform: linux/arm/v7
os: ubuntu-latest
steps:
- name: Clean tools folder
run: cd /opt && find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';'
- name: Checkout
uses: actions/checkout@v4
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
- name: Login to container registry
uses: docker/login-action@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
context: .
file: ./images/${{ matrix.platform }}/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: ${{ matrix.platform }}
push: ${{ github.ref == 'refs/heads/main' }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ env.IMAGE_NAME }}
outputs: type=image,push-by-digest=true,name-canonical=true,push=${{ github.ref == 'refs/heads/main' }}
- name: Export digest
if: ${{ github.ref == 'refs/heads/main' }}
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
merge:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true
- name: Login to container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},value=${{ env.RELEASE_VERSION }}
type=raw,value=latest
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}