2 Commits

Author SHA1 Message Date
830715abb3 fix(ci): skip docker if unavailable, no latest tag for prereleases
All checks were successful
Test and Build / test (push) Successful in 1m33s
Test and Build / build (push) Successful in 8s
Gitea: Skip docker build gracefully if docker command not available
GitHub: Only tag as latest for stable releases (not alpha/beta/rc)
2025-11-30 22:36:03 -05:00
291d0e78df fix(ci): handle missing sudo on Gitea, push to ghcr.io on GitHub
Some checks failed
Test and Build / test (push) Successful in 1m34s
Test and Build / build (push) Failing after 8s
Gitea: Try ffmpeg, then sudo apt-get, then apt-get without sudo
GitHub: Login to ghcr.io and push tagged image to container registry
2025-11-30 18:32:55 -05:00
2 changed files with 43 additions and 15 deletions

View File

@@ -24,7 +24,14 @@ jobs:
run: $HOME/.local/bin/uv sync run: $HOME/.local/bin/uv sync
- name: Install FFmpeg - name: Install FFmpeg
run: sudo apt-get update && sudo apt-get install -y ffmpeg run: |
if command -v ffmpeg &> /dev/null; then
echo "FFmpeg already installed"
elif command -v sudo &> /dev/null; then
sudo apt-get update && sudo apt-get install -y ffmpeg
else
apt-get update && apt-get install -y ffmpeg
fi
- name: Run tests - name: Run tests
run: $HOME/.local/bin/uv run pytest tests/ -v --ignore=tests/test_integration.py run: $HOME/.local/bin/uv run pytest tests/ -v --ignore=tests/test_integration.py
@@ -41,8 +48,10 @@ jobs:
- name: Build Docker image - name: Build Docker image
run: | run: |
docker build -t ffmpeg-worker:${{ steps.version.outputs.VERSION }} . if command -v docker &> /dev/null; then
docker tag ffmpeg-worker:${{ steps.version.outputs.VERSION }} ffmpeg-worker:latest docker build -t ffmpeg-worker:${{ steps.version.outputs.VERSION }} .
docker tag ffmpeg-worker:${{ steps.version.outputs.VERSION }} ffmpeg-worker:latest
- name: List images docker images | grep ffmpeg-worker
run: docker images | grep ffmpeg-worker else
echo "Docker not available - skipping build"
fi

View File

@@ -5,6 +5,10 @@ on:
tags: tags:
- 'v*.*.*' - 'v*.*.*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -29,23 +33,38 @@ jobs:
build: build:
needs: test needs: test
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-rc') }}
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Extract version from tag - name: Build and push Docker image
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build Docker image
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: . context: .
push: false push: true
tags: | tags: ${{ steps.meta.outputs.tags }}
ffmpeg-worker:${{ steps.version.outputs.VERSION }} labels: ${{ steps.meta.outputs.labels }}
ffmpeg-worker:latest
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max