v1.0.1 #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: publish | |
| on: | |
| release: | |
| types: | |
| - published | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| concurrency: | |
| group: publish-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Baixa o repositorio para montar a imagem a partir do Dockerfile versionado. | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| # Habilita emulacao para publicar amd64 e arm64 a partir do runner padrao. | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| # Prepara o builder Buildx com suporte a multiplataforma e cache. | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| # Faz login no GHCR usando o token nativo do workflow, como recomendado pela documentacao do GitHub. | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Gera tags OCI a partir da release publicada. | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ghcr.io/${{ github.repository_owner }}/debugtools | |
| tags: | | |
| type=raw,value=${{ github.event.release.tag_name }} | |
| type=raw,value=latest,enable=${{ github.event.release.prerelease == false }} | |
| # Monta a imagem, roda o build multiplataforma e publica no GHCR quando a release for publicada. | |
| - name: Build and push | |
| id: build | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| pull: true | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # Publica atestacao de proveniencia da imagem publicada no GHCR. | |
| - name: Attest build provenance | |
| uses: actions/attest-build-provenance@v4 | |
| with: | |
| subject-name: ghcr.io/${{ github.repository_owner }}/debugtools | |
| subject-digest: ${{ steps.build.outputs.digest }} | |
| push-to-registry: true |