diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f38062a..f95574e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: permissions: # To upload archives as GitHub Releases contents: write - # To push Docker images + # To push Docker images to GHCR packages: write # To sign the provenance attestation for the release archives id-token: write @@ -46,6 +46,14 @@ jobs: run: | echo "${DOCKERHUB_TOKEN}" | docker login --username "${DOCKERHUB_USERNAME}" --password-stdin + - name: GHCR Login + if: success() && startsWith(github.ref, 'refs/tags/v') + env: + GHCR_USERNAME: ${{ github.actor }} + GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "${GHCR_TOKEN}" | docker login ghcr.io --username "${GHCR_USERNAME}" --password-stdin + - name: Install Syft uses: anchore/sbom-action/download-syft@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3 diff --git a/.goreleaser.yml b/.goreleaser.yml index 6fca967..28f6a64 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -60,7 +60,7 @@ dockers_v2: - id: publiccode-parser ids: [publiccode-parser] dockerfile: Dockerfile.goreleaser - images: [publiccodeyml/libpubliccode] + images: [publiccodeyml/libpubliccode, ghcr.io/publiccodeyml/libpubliccode] tags: - "{{ .Tag }}" - latest @@ -76,7 +76,7 @@ dockers_v2: - id: publiccode-parser-amd64 ids: [publiccode-parser] dockerfile: Dockerfile.goreleaser - images: [publiccodeyml/libpubliccode] + images: [publiccodeyml/libpubliccode, ghcr.io/publiccodeyml/libpubliccode] tags: ["{{ .Tag }}-amd64"] platforms: [linux/amd64] disable: "{{ .IsSnapshot }}" @@ -86,7 +86,7 @@ dockers_v2: - id: publiccode-parser-arm64 ids: [publiccode-parser] dockerfile: Dockerfile.goreleaser - images: [publiccodeyml/libpubliccode] + images: [publiccodeyml/libpubliccode, ghcr.io/publiccodeyml/libpubliccode] tags: ["{{ .Tag }}-arm64"] platforms: [linux/arm64] disable: "{{ .IsSnapshot }}"