diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 608d82ead..3a6eec9ef 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,6 +2,7 @@ name: Create release permissions: contents: write + packages: write on: push: @@ -23,6 +24,14 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + continue-on-error: true + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Golang uses: actions/setup-go@v5 with: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index ca87fb186..e856e9f03 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -38,6 +38,7 @@ archives: dockers: - image_templates: - &amd64_image "{{ .ProjectName }}:{{ .Tag }}-amd64" + - &ghcr_amd64_image "ghcr.io/{{ .ProjectName }}:{{ .Tag }}-amd64" build_flag_templates: - --platform=linux/amd64 goarch: amd64 @@ -46,6 +47,7 @@ dockers: - image_templates: - &arm64v8_image "{{ .ProjectName }}:{{ .Tag }}-arm64" + - &ghcr_arm64v8_image "ghcr.io/{{ .ProjectName }}:{{ .Tag }}-arm64" build_flag_templates: - --platform=linux/arm64 goarch: arm64 @@ -54,6 +56,7 @@ dockers: - image_templates: - &armv7_image "{{ .ProjectName }}:{{ .Tag }}-armv7" + - &ghcr_armv7_image "ghcr.io/{{ .ProjectName }}:{{ .Tag }}-armv7" build_flag_templates: - --platform=linux/arm/v7 goarch: arm @@ -70,3 +73,11 @@ docker_manifests: - name_template: "{{ .ProjectName }}:latest" skip_push: auto image_templates: *multiarch_images + - name_template: "ghcr.io/{{ .ProjectName }}:{{ .Tag }}" + image_templates: &ghcr_multiarch_images + - *ghcr_amd64_image + - *ghcr_arm64v8_image + - *ghcr_armv7_image + - name_template: "ghcr.io/{{ .ProjectName }}:latest" + skip_push: auto + image_templates: *ghcr_multiarch_images