Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use ghcr.io rather than Docker Hub #343

Merged
merged 1 commit into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checks-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: actions/checkout@v3

- name: Install tools via asdf
uses: asdf-vm/actions/setup@v1.1.0
uses: asdf-vm/actions/setup@master
with:
asdf_branch: v0.11.0

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@v3

- name: Install asdf
uses: asdf-vm/actions/setup@v1.1.0
uses: asdf-vm/actions/setup@master
with:
asdf_branch: v0.11.0

Expand All @@ -48,7 +48,7 @@ jobs:
fetch-depth: 0

- name: Install asdf
uses: asdf-vm/actions/setup@v1.1.0
uses: asdf-vm/actions/setup@master
with:
asdf_branch: v0.11.0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
languages: ${{ matrix.language }}

- name: Install tools via asdf
uses: asdf-vm/actions/install@v1.1.0
uses: asdf-vm/actions/install@master
with:
asdf_branch: v0.11.0

Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/release-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ on:
branches:
- main

permissions:
contents: write
packages: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: google-github-actions/[email protected]
id: release-please
Expand All @@ -27,16 +32,17 @@ jobs:

- if: ${{ steps.release-please.outputs.release_created }}
name: Install tools via asdf
uses: asdf-vm/actions/setup@v1.1.0
uses: asdf-vm/actions/setup@master
with:
asdf_branch: v0.11.0

- if: ${{ steps.release-please.outputs.release_created }}
name: Login to Docker Hub
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- if: ${{ steps.release-please.outputs.release_created }}
name: Release
Expand Down
15 changes: 8 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,17 @@ archives:
format: zip
builds:
- mindthegap
rlcp: true
dockers:
- image_templates:
# Specify the image tag including `-amd64` suffix if the build is not a snapshot build or is not being built on
# arm64 machine. This allows for using the snapshot image build without the archtecture specific suffix
# consistently on local machines, i.e. can always use `mesosphere/mindthegap:v<VERSION>` on the machine the snapshot
# consistently on local machines, i.e. can always use `ghcr.io/mesosphere/mindthegap:v<VERSION>` on the machine the snapshot
# is built on.
#
# For a release build the `-amd64` suffix will always be included and the `docker_manifests` specification below
# will create the final multiplatform manifest to be pushed to the registry.
- 'mesosphere/mindthegap:v{{trimprefix .Version "v"}}{{ if or (not .IsSnapshot) (not (eq .Runtime.Goarch "amd64")) }}-amd64{{ end }}'
- 'ghcr.io/mesosphere/mindthegap:v{{trimprefix .Version "v"}}{{ if or (not .IsSnapshot) (not (eq .Runtime.Goarch "amd64")) }}-amd64{{ end }}'
use: buildx
dockerfile: Dockerfile
build_flag_templates:
Expand All @@ -80,12 +81,12 @@ dockers:
- image_templates:
# Specify the image tag including `-amd64v8` suffix if the build is not a snapshot build or is not being built on
# arm64 machine. This allows for using the snapshot image build without the archtecture specific suffix
# consistently on local machines, i.e. can always use `mesosphere/mindthegap:v<VERSION>` on the machine the snapshot
# consistently on local machines, i.e. can always use `ghcr.io/mesosphere/mindthegap:v<VERSION>` on the machine the snapshot
# is built on.
#
# For a release build the `-amd64v8` suffix will always be included and the `docker_manifests` specification below
# will create the final multiplatform manifest to be pushed to the registry.
- 'mesosphere/mindthegap:v{{trimprefix .Version "v"}}{{ if or (not .IsSnapshot) (not (eq .Runtime.Goarch "arm64")) }}-arm64v8{{ end }}'
- 'ghcr.io/mesosphere/mindthegap:v{{trimprefix .Version "v"}}{{ if or (not .IsSnapshot) (not (eq .Runtime.Goarch "arm64")) }}-arm64v8{{ end }}'
use: buildx
goarch: arm64
dockerfile: Dockerfile
Expand All @@ -98,10 +99,10 @@ dockers:
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
docker_manifests:
- name_template: mesosphere/mindthegap:v{{trimprefix .Version "v"}}
- name_template: ghcr.io/mesosphere/mindthegap:v{{trimprefix .Version "v"}}
image_templates:
- mesosphere/mindthegap:v{{trimprefix .Version "v"}}-amd64
- mesosphere/mindthegap:v{{trimprefix .Version "v"}}-arm64v8
- ghcr.io/mesosphere/mindthegap:v{{trimprefix .Version "v"}}-amd64
- ghcr.io/mesosphere/mindthegap:v{{trimprefix .Version "v"}}-arm64v8
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down