Skip to content

Commit

Permalink
Merge pull request #63 from ccremer/registry
Browse files Browse the repository at this point in the history
Switch image registry to ghcr.io
  • Loading branch information
ccremer authored Jan 4, 2022
2 parents 0c755f1 + d0fef6b commit 8d01b08
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 46 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,12 @@ jobs:
with:
gpg_private_key: ${{ secrets.SIGNING_KEY }}

- name: Login to docker.io
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Login to quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USER }}
password: ${{ secrets.QUAY_IO_PASSWORD }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build changelog from PRs with labels
id: build_changelog
Expand All @@ -73,3 +67,4 @@ jobs:
args: release --release-notes .github/release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_REPOSITORY: ${{ github.repository }}
43 changes: 9 additions & 34 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,52 +31,27 @@ dockers:
build_flag_templates:
- "--platform=linux/amd64"
image_templates:
- "docker.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-amd64"
- "quay.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-amd64"
- "ghcr.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-amd64"

- goarch: arm64
use_buildx: true
build_flag_templates:
- "--platform=linux/arm64/v8"
image_templates:
- "docker.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-arm64"
- "quay.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-arm64"
- "ghcr.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-arm64"

docker_manifests:
# For prereleases, updating `latest` and the floating tags of the major version does not make sense.
# For prereleases, updating `latest` does not make sense.
# Only the image for the exact version should be pushed.

# Quay.io
- name_template: "{{ if not .Prerelease }}quay.io/{{ .Env.IMAGE_REPOSITORY }}:latest{{ end }}"
image_templates:
- "quay.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-amd64"
- "quay.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-arm64"

- name_template: "{{ if not .Prerelease }}quay.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Major }}{{ end }}"
image_templates:
- "quay.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-amd64"
- "quay.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-arm64"

- name_template: "quay.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}"
image_templates:
- "quay.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-amd64"
- "quay.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-arm64"

# Docker.io
- name_template: "{{ if not .Prerelease }}docker.io/{{ .Env.IMAGE_REPOSITORY }}:latest{{ end }}"
image_templates:
- "docker.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-amd64"
- "docker.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-arm64"

- name_template: "{{ if not .Prerelease }}docker.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Major }}{{ end }}"
- name_template: "{{ if not .Prerelease }}ghcr.io/{{ .Env.IMAGE_REPOSITORY }}:latest{{ end }}"
image_templates:
- "docker.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-amd64"
- "docker.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-arm64"
- "ghcr.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-amd64"
- "ghcr.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-arm64"

- name_template: "docker.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}"
- name_template: "ghcr.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}"
image_templates:
- "docker.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-amd64"
- "docker.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-arm64"
- "ghcr.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-amd64"
- "ghcr.io/{{ .Env.IMAGE_REPOSITORY }}:v{{ .Version }}-arm64"

nfpms:
- vendor: ccremer
Expand Down
3 changes: 1 addition & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ image:https://img.shields.io/codeclimate/maintainability/ccremer/fronius-exporte
image:https://img.shields.io/codeclimate/coverage/ccremer/fronius-exporter[Tests,link=https://codeclimate.com/github/ccremer/fronius-exporter]
image:https://img.shields.io/github/v/release/ccremer/fronius-exporter[Releases,link=https://github.com/ccremer/fronius-exporter/releases]
image:https://img.shields.io/github/license/ccremer/fronius-exporter[License,link=https://github.com/ccremer/fronius-exporter/blob/master/LICENSE]
image:https://img.shields.io/badge/container-quay.io-blue[Container image,link=https://quay.io/repository/ccremer/fronius-exporter?tab=tags]
endif::[]

== About
Expand All @@ -39,7 +38,7 @@ image::examples/grafana.png[Grafana]

=== Docker

. `docker run -d --name fronius-exporter -p "8080:8080" quay.io/ccremer/fronius-exporter --help`
. `docker run -d --name fronius-exporter -p "8080:8080" ghcr.io/ccremer/fronius-exporter --help`

=== Helm Chart

Expand Down

0 comments on commit 8d01b08

Please sign in to comment.