name: Build & publish Docker image # Publishes the FireSight container image to GitHub Container Registry # (ghcr.io//) so the Unraid Community Apps template can pull it. # # Triggers: # - push to main -> tags `latest` and `main-` # - push of a v* tag -> tags `vX.Y.Z`, `X.Y`, `X` and `latest` # - manual run -> tags `latest` # # Multi-arch: linux/amd64 (Unraid) + linux/arm64 (Pi / Apple Silicon test). on: push: branches: [main] tags: ["v*.*.*"] workflow_dispatch: permissions: contents: read packages: write concurrency: group: docker-${{ 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 Buildx uses: docker/setup-buildx-action@v3 - name: Log in to GHCR uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Lowercase image name id: img run: echo "name=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT" - name: Derive tags & labels id: meta uses: docker/metadata-action@v5 with: images: ${{ steps.img.outputs.name }} tags: | type=ref,event=branch type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=raw,value=latest,enable={{is_default_branch}} type=sha,prefix=main-,enable=${{ github.ref == 'refs/heads/main' }} - name: Build & push uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max