2 Commits

Author SHA1 Message Date
177343fdbb feat(ci): push to Gitea container registry
Requires Docker on runner and REGISTRY_TOKEN secret configured.
Pushes to git.prettyhefty.com/bill/ffmpeg-worker with version tags.
2025-11-30 22:43:27 -05:00
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
2 changed files with 25 additions and 6 deletions

View File

@@ -5,6 +5,10 @@ on:
tags:
- 'v*.*.*'
env:
REGISTRY: git.prettyhefty.com
IMAGE_NAME: bill/ffmpeg-worker
jobs:
test:
runs-on: ubuntu-latest
@@ -44,12 +48,27 @@ jobs:
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build Docker image
run: |
docker build -t ffmpeg-worker:${{ steps.version.outputs.VERSION }} .
docker tag ffmpeg-worker:${{ steps.version.outputs.VERSION }} ffmpeg-worker:latest
VERSION=${GITHUB_REF#refs/tags/}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
if [[ "$VERSION" == *-alpha* ]] || [[ "$VERSION" == *-beta* ]] || [[ "$VERSION" == *-rc* ]]; then
echo "IS_PRERELEASE=true" >> $GITHUB_OUTPUT
else
echo "IS_PRERELEASE=false" >> $GITHUB_OUTPUT
fi
- name: Log in to Container Registry
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ gitea.actor }} --password-stdin
- name: Build and push Docker image
run: |
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }} .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}
if [ "${{ steps.version.outputs.IS_PRERELEASE }}" = "false" ]; then
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
fi
- name: List images
run: docker images | grep ffmpeg-worker

View File

@@ -54,7 +54,7 @@ jobs:
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
type=raw,value=latest,enable=${{ !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-rc') }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3