Musicseerr/.github/workflows/release.yml
2026-04-03 15:53:00 +01:00

63 lines
1.7 KiB
YAML

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: read
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version from tag
id: version
run: echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
- name: Get build date
id: date
run: echo "timestamp=$(git log -1 --pretty=%cI)" >> "$GITHUB_OUTPUT"
- name: Build and push (versioned)
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/habirabbu/musicseerr:${{ steps.version.outputs.tag }}
build-args: |
COMMIT_TAG=${{ steps.version.outputs.tag }}
BUILD_DATE=${{ steps.date.outputs.timestamp }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
- name: Tag latest (stable releases only)
if: ${{ !contains(steps.version.outputs.tag, '-') }}
run: |
docker buildx imagetools create \
-t ghcr.io/habirabbu/musicseerr:latest \
ghcr.io/habirabbu/musicseerr:${{ steps.version.outputs.tag }}