Skip to content

Commit

Permalink
Add publishing docker images to ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
chr-fritz committed May 25, 2024
1 parent 1f02e77 commit 91a35d8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 8 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ on:
tags:
- '*'

permissions:
contents: read
permissions: { }

jobs:
release:
permissions:
contents: read
contents: write
packages: write
runs-on: ubuntu-latest
steps:
Expand All @@ -32,12 +31,19 @@ jobs:
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_CHARTS_PRIVATE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOBIN: /usr/local/bin/
43 changes: 39 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ dockers:
- "quay.io/chrfritz/knx-exporter:{{ .Tag }}-x64"
- "quay.io/chrfritz/knx-exporter:v{{ .Major }}.{{ .Minor }}-x64"
- "quay.io/chrfritz/knx-exporter:v{{ .Major }}-x64"
- "ghcr.io/chr-fritz/knx-exporter:latest-x64"
- "ghcr.io/chr-fritz/knx-exporter:{{ .Tag }}-x64"
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}.{{ .Minor }}-x64"
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}-x64"
skip_push: false
dockerfile: Dockerfile
build_flag_templates:
Expand All @@ -77,6 +81,10 @@ dockers:
- "quay.io/chrfritz/knx-exporter:{{ .Tag }}-arm64"
- "quay.io/chrfritz/knx-exporter:v{{ .Major }}.{{ .Minor }}-arm64"
- "quay.io/chrfritz/knx-exporter:v{{ .Major }}-arm64"
- "ghcr.io/chr-fritz/knx-exporter:latest-arm64"
- "ghcr.io/chr-fritz/knx-exporter:{{ .Tag }}-arm64"
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}.{{ .Minor }}-arm64"
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}-arm64"
skip_push: false
dockerfile: Dockerfile
build_flag_templates:
Expand All @@ -102,6 +110,10 @@ dockers:
- "quay.io/chrfritz/knx-exporter:{{ .Tag }}-arm7"
- "quay.io/chrfritz/knx-exporter:v{{ .Major }}.{{ .Minor }}-arm7"
- "quay.io/chrfritz/knx-exporter:v{{ .Major }}-arm7"
- "ghcr.io/chr-fritz/knx-exporter:latest-arm7"
- "ghcr.io/chr-fritz/knx-exporter:{{ .Tag }}-arm7"
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}.{{ .Minor }}-arm7"
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}-arm7"
skip_push: false
dockerfile: Dockerfile
build_flag_templates:
Expand Down Expand Up @@ -137,6 +149,26 @@ docker_manifests:
- "quay.io/chrfritz/knx-exporter:v{{ .Major }}-x64"
- "quay.io/chrfritz/knx-exporter:v{{ .Major }}-arm64"
- "quay.io/chrfritz/knx-exporter:v{{ .Major }}-arm7"
- name_template: "ghcr.io/chr-fritz/knx-exporter:latest"
image_templates:
- "ghcr.io/chr-fritz/knx-exporter:latest-x64"
- "ghcr.io/chr-fritz/knx-exporter:latest-arm64"
- "ghcr.io/chr-fritz/knx-exporter:latest-arm7"
- name_template: "ghcr.io/chr-fritz/knx-exporter:{{ .Tag }}"
image_templates:
- "ghcr.io/chr-fritz/knx-exporter:{{ .Tag }}-x64"
- "ghcr.io/chr-fritz/knx-exporter:{{ .Tag }}-arm64"
- "ghcr.io/chr-fritz/knx-exporter:{{ .Tag }}-arm7"
- name_template: "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}.{{ .Minor }}"
image_templates:
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}.{{ .Minor }}-x64"
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}.{{ .Minor }}-arm64"
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}.{{ .Minor }}-arm7"
- name_template: "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}"
image_templates:
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}-x64"
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}-arm64"
- "ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}-arm7"
brews:
- repository:
owner: chr-fritz
Expand Down Expand Up @@ -208,12 +240,15 @@ release:
footer: |
## Docker Images
[quay.io/chrfritz/knx-exporter](https://quay.io/chrfritz/knx-exporter)
[ghcr.io/chr-fritz/knx-exporter](https://ghcr.io/chr-fritz/knx-exporter)
* `ghcr.io/chr-fritz/knx-exporter:latest`
* `ghcr.io/chr-fritz/knx-exporter:{{ .Tag }}`
* `ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}.{{ .Minor }}`
* `ghcr.io/chr-fritz/knx-exporter:v{{ .Major }}`
[quay.io/chrfritz/knx-exporter](https://quay.io/chrfritz/knx-exporter) (deprecated)
* `quay.io/chrfritz/knx-exporter:latest`
* `quay.io/chrfritz/knx-exporter:{{ .Tag }}`
* `quay.io/chrfritz/knx-exporter:v{{ .Major }}.{{ .Minor }}`
* `quay.io/chrfritz/knx-exporter:v{{ .Major }}`
## Thanks!
Those were the changes on {{ .Tag }}!
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

FROM scratch
LABEL org.opencontainers.image.description="The KNX Prometheus Exporter is a small bridge to export values measured by KNX sensors to Prometheus."
COPY scripts/docker/etc_passwd /etc/passwd
COPY knx-exporter /
COPY pkg/.knx-exporter.yaml /etc/knx-exporter.yaml
Expand Down

0 comments on commit 91a35d8

Please sign in to comment.