diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d5d7601..810fec3 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -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 @@ -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 diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 80865aa..c6dd52a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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 @@ -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 @@ -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 diff --git a/README.md b/README.md index 09389cc..2c07e9f 100644 --- a/README.md +++ b/README.md @@ -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