Skip to content

Commit

Permalink
feat: add ghcr docker mirror (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlie-haley authored Apr 9, 2022
1 parent a9cc0c9 commit bfa9b2f
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 39 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ on:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-20.04
env:
DOCKER_REGISTRY: registry.hub.docker.com
DOCKER_IMAGE: chhaley/omada_exporter
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
steps:
- name: Checkout the code
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout the code
uses: actions/checkout@v1

- name: Set up QEMU
Expand All @@ -25,10 +20,18 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v1

- name: Docker Login
if: success()
run: |
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${DOCKER_USERNAME}
password: ${DOCKER_PASSWORD}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: "charlie-haley"
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Go
uses: actions/setup-go@v2
Expand Down
89 changes: 64 additions & 25 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ builds:

dockers:
- image_templates:
- "chhaley/omada_exporter:latest-amd64"
- "chhaley/omada_exporter:{{ .Version }}-amd64"
- "chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64"
- "chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}-amd64"
- "chhaley/omada_exporter:{{ .Major }}-amd64"
- "docker.io/chhaley/omada_exporter:latest-amd64"
- "docker.io/chhaley/omada_exporter:{{ .Version }}-amd64"
- "docker.io/chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64"
- "docker.io/chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}-amd64"
- "docker.io/chhaley/omada_exporter:{{ .Major }}-amd64"

- "ghcr.io/charlie-haley/omada_exporter:latest-amd64"
- "ghcr.io/charlie-haley/omada_exporter:{{ .Version }}-amd64"
- "ghcr.io/charlie-haley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64"
- "ghcr.io/charlie-haley/omada_exporter:{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/charlie-haley/omada_exporter:{{ .Major }}-amd64"
use: buildx
dockerfile: Dockerfile
goarch: amd64
Expand All @@ -42,11 +48,17 @@ dockers:
- "--build-arg=VCS_REF={{.FullCommit}}"
- "--platform=linux/amd64"
- image_templates:
- "chhaley/omada_exporter:latest-arm64v8"
- "chhaley/omada_exporter:{{ .Version }}-arm64v8"
- "chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64v8"
- "chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}-arm64v8"
- "chhaley/omada_exporter:{{ .Major }}-arm64v8"
- "docker.io/chhaley/omada_exporter:latest-arm64v8"
- "docker.io/chhaley/omada_exporter:{{ .Version }}-arm64v8"
- "docker.io/chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64v8"
- "docker.io/chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}-arm64v8"
- "docker.io/chhaley/omada_exporter:{{ .Major }}-arm64v8"

- "ghcr.io/charlie-haley/omada_exporter:latest-arm64v8"
- "ghcr.io/charlie-haley/omada_exporter:{{ .Version }}-arm64v8"
- "ghcr.io/charlie-haley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64v8"
- "ghcr.io/charlie-haley/omada_exporter:{{ .Major }}.{{ .Minor }}-arm64v8"
- "ghcr.io/charlie-haley/omada_exporter:{{ .Major }}-arm64v8"
use: buildx
dockerfile: Dockerfile
goarch: arm64
Expand All @@ -62,30 +74,57 @@ dockers:
- "--platform=linux/arm64/v8"

docker_manifests:
- name_template: chhaley/omada_exporter:latest
## Docker Hub
- name_template: docker.io/chhaley/omada_exporter:latest
image_templates:
- docker.io/chhaley/omada_exporter:latest-amd64
- docker.io/chhaley/omada_exporter:latest-arm64v8

- name_template: docker.io/chhaley/omada_exporter:{{ .Version }}
image_templates:
- docker.io/chhaley/omada_exporter:{{ .Version }}-amd64
- docker.io/chhaley/omada_exporter:{{ .Version }}-arm64v8

- name_template: docker.io/chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}
image_templates:
- docker.io/chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64
- docker.io/chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64v8

- name_template: docker.io/chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}
image_templates:
- docker.io/chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}-amd64
- docker.io/chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}-arm64v8

- name_template: docker.io/chhaley/omada_exporter:{{ .Major }}
image_templates:
- docker.io/chhaley/omada_exporter:{{ .Major }}-amd64
- docker.io/chhaley/omada_exporter:{{ .Major }}-arm64v8

## GHCR
- name_template: ghcr.io/charlie-haley/omada_exporter:latest
image_templates:
- chhaley/omada_exporter:latest-amd64
- chhaley/omada_exporter:latest-arm64v8
- ghcr.io/charlie-haley/omada_exporter:latest-amd64
- ghcr.io/charlie-haley/omada_exporter:latest-arm64v8

- name_template: chhaley/omada_exporter:{{ .Version }}
- name_template: ghcr.io/charlie-haley/omada_exporter:{{ .Version }}
image_templates:
- chhaley/omada_exporter:{{ .Version }}-amd64
- chhaley/omada_exporter:{{ .Version }}-arm64v8
- ghcr.io/charlie-haley/omada_exporter:{{ .Version }}-amd64
- ghcr.io/charlie-haley/omada_exporter:{{ .Version }}-arm64v8

- name_template: chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}
- name_template: ghcr.io/charlie-haley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}
image_templates:
- chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64
- chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64v8
- ghcr.io/charlie-haley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64
- ghcr.io/charlie-haley/omada_exporter:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64v8

- name_template: chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}
- name_template: ghcr.io/charlie-haley/omada_exporter:{{ .Major }}.{{ .Minor }}
image_templates:
- chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}-amd64
- chhaley/omada_exporter:{{ .Major }}.{{ .Minor }}-arm64v8
- ghcr.io/charlie-haley/omada_exporter:{{ .Major }}.{{ .Minor }}-amd64
- ghcr.io/charlie-haley/omada_exporter:{{ .Major }}.{{ .Minor }}-arm64v8

- name_template: chhaley/omada_exporter:{{ .Major }}
- name_template: ghcr.io/charlie-haley/omada_exporter:{{ .Major }}
image_templates:
- chhaley/omada_exporter:{{ .Major }}-amd64
- chhaley/omada_exporter:{{ .Major }}-arm64v8
- ghcr.io/charlie-haley/omada_exporter:{{ .Major }}-amd64
- ghcr.io/charlie-haley/omada_exporter:{{ .Major }}-arm64v8

release:
prerelease: auto
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ docker run -d \
chhaley/omada_exporter
```

__There's also a GHCR mirror available if you'd prefer to not use Docker Hub. `ghcr.io/charlie-haley/omada_exporter`__

### ☸️ Helm
```bash
helm repo add charlie-haley http://charts.charliehaley.dev
Expand Down

0 comments on commit bfa9b2f

Please sign in to comment.