Skip to content

ffmpeg

ffmpeg #174

Workflow file for this run

name: ffmpeg
on:
push:
paths:
- 'Dockerfile'
- 'scripts/base.sh'
- 'scripts/build-ffmpeg.sh'
- '.github/workflows/ffmpeg.yml'
branches: [main]
workflow_run:
workflows: ["ffmpeg-library-build"]
branches: [main]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') == false && (github.event_name == 'push' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success'))
strategy:
matrix:
ffmpeg: ["7.0.2", "6.1.2", "5.1.6", "4.4.5"]
flavor: [linux, windows]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: akashisn
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: akashisn
password: ${{ github.token }}
- name: Set build target (linux)
if: matrix.flavor == 'linux'
run: |
echo "target=ffmpeg-linux" >> $GITHUB_ENV
echo "image_name=akashisn/ffmpeg" >> $GITHUB_ENV
echo "image_tag=${{ matrix.ffmpeg }}" >> $GITHUB_ENV
- name: Set build target (windows)
if: matrix.flavor == 'windows'
run: |
echo "target=ffmpeg-windows" >> $GITHUB_ENV
echo "image_name=ghcr.io/akashisn/ffmpeg-windows" >> $GITHUB_ENV
echo "image_tag=${{ matrix.ffmpeg }}" >> $GITHUB_ENV
- name: Build and push - ffmpeg
uses: docker/build-push-action@v4
with:
context: ./
file: ./Dockerfile
tags: |
${{ env.image_name }}:${{ env.image_tag }}
build-args: |
FFMPEG_VERSION=${{ matrix.ffmpeg }}
platforms: linux/amd64
target: ${{ env.target }}
cache-from: type=gha
cache-to: type=gha,mode=max
push: true