Build and Deploy FFmpeg #87
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy FFmpeg | |
| on: | |
| push: | |
| branches: | |
| - trunk | |
| paths: | |
| - '.ffmpeg/Dockerfile' | |
| pull_request: | |
| paths: | |
| - '.ffmpeg/Dockerfile' | |
| workflow_dispatch: | |
| inputs: | |
| release: | |
| description: 'Deploy a new release' | |
| required: false | |
| type: boolean | |
| default: false | |
| jobs: | |
| deploy: | |
| name: Build and Deploy FFmpeg | |
| runs-on: ubuntu-24.04 | |
| permissions: write-all | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@main | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Set up containerd image store feature | |
| uses: nick-invision/retry@master | |
| with: | |
| timeout_minutes: 10 | |
| max_attempts: 3 | |
| command: | | |
| make setup_dev_env | |
| - name: Output Docker info | |
| run: docker info | |
| - name: Sets build date | |
| run: | | |
| echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV | |
| echo "NAME=${NAMESPACE}" >> $GITHUB_ENV | |
| make set_build_multiarch | |
| cat .env | xargs -I {} echo {} >> $GITHUB_ENV | |
| env: | |
| NAMESPACE: ${{ vars.DOCKER_NAMESPACE || 'selenium' }} | |
| AUTHORS: ${{ vars.AUTHORS || github.repository_owner }} | |
| - name: Build images | |
| uses: nick-invision/retry@master | |
| with: | |
| timeout_minutes: 300 | |
| max_attempts: 2 | |
| retry_wait_seconds: 60 | |
| command: | | |
| PLATFORMS="${PLATFORMS}" make ffmpeg | |
| make tag_ffmpeg_latest | |
| - name: Login Docker Hub | |
| if: ${{ github.event.inputs.release == 'true' }} | |
| run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" | |
| env: | |
| DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} | |
| DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | |
| - name: Login GitHub Container Registry | |
| if: ${{ github.event.inputs.release == 'true' }} | |
| run: echo "${{ secrets.SELENIUM_CI_TOKEN }}" | docker login ghcr.io -u "${{ secrets.SELENIUM_CI_USERNAME }}" --password-stdin | |
| - name: Deploy new images | |
| if: ${{ github.event.inputs.release == 'true' }} | |
| uses: nick-invision/retry@master | |
| with: | |
| timeout_minutes: 20 | |
| max_attempts: 5 | |
| retry_wait_seconds: 300 | |
| command: | | |
| make release_ffmpeg_latest | |
| - name: Mirror images to GHCR | |
| if: ${{ github.event.inputs.release == 'true' }} | |
| uses: nick-invision/retry@master | |
| with: | |
| timeout_minutes: 20 | |
| max_attempts: 5 | |
| retry_wait_seconds: 300 | |
| command: | | |
| GHCR_NAMESPACE="ghcr.io/$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" make release_ffmpeg_ghcr_latest |