From 86472005d053d8b1bbf27139ce6a443c35b47f53 Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Fri, 20 May 2022 10:42:23 +0200 Subject: [PATCH] feat: publish docker images to GitHub Registry --- .github/workflows/release.yml | 7 +++++++ .goreleaser.yml | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a71d9b..7acefd6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,6 +45,13 @@ jobs: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2.9.1 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index 4d3a307..73aa745 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -16,6 +16,7 @@ dockers: goarch: amd64 image_templates: - "hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64" + - "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64" build_flag_templates: - "--platform=linux/amd64" - "--build-arg=VERSION={{.Version}}" @@ -26,6 +27,7 @@ dockers: goarch: arm64 image_templates: - "hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64" + - "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64" build_flag_templates: - "--platform=linux/arm64/v8" - "--build-arg=VERSION={{.Version}}" @@ -48,6 +50,22 @@ docker_manifests: image_templates: - "hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64" - "hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64" + - name_template: "ghcr.io/hipages/php-fpm_exporter:latest" + image_templates: + - "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64" + - "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64" + - name_template: "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}" + image_templates: + - "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64" + - "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64" + - name_template: "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}" + image_templates: + - "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64" + - "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64" + - name_template: "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}" + image_templates: + - "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64" + - "ghcr.io/hipages/php-fpm_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64" changelog: filters: