name: Release on: push: tags: - "*" concurrency: group: release-${{ github.ref }} cancel-in-progress: true permissions: actions: write contents: read packages: write id-token: write attestations: write jobs: docker: name: Docker Release (${{ matrix.target }}) runs-on: ubuntu-latest strategy: matrix: include: - target: final tag_suffix: "" - target: debug-shell tag_suffix: "-shell" steps: - name: Check out the repo uses: actions/checkout@v6 - name: Extract Docker metadata id: meta uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository }} tags: | type=semver,pattern={{version}} flavor: | latest=auto suffix=${{ matrix.tag_suffix }},onlatest=true - 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.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push id: push uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile target: ${{ matrix.target }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64, linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max build-args: | IMAGE_TAG=ghcr.io/${{ github.repository }}:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} HEADPLANE_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} - name: Attest build provenance uses: actions/attest-build-provenance@v2 with: subject-name: ghcr.io/${{ github.repository }} subject-digest: ${{ steps.push.outputs.digest }} push-to-registry: true