name: Compiler Build

on:
  workflow_dispatch:

env:
  COMPILER_IMAGE: ghcr.io/stashapp/compiler:13

jobs:
  build-compiler:
    runs-on: ubuntu-24.04
    steps:
    - uses: actions/checkout@v6
    - uses: docker/login-action@v3
      with:
        registry: ghcr.io
        username: ${{ github.repository_owner }}
        password: ${{ secrets.GITHUB_TOKEN }}
    - uses: docker/setup-buildx-action@v3
    - uses: docker/build-push-action@v6
      with:
        push: true
        context: "{{defaultContext}}:docker/compiler"
        tags: |
          ${{ env.COMPILER_IMAGE }}
          ghcr.io/stashapp/compiler:latest
        cache-from: type=gha,scope=all,mode=max
        cache-to: type=gha,scope=all,mode=max