Skip to content

Commit

Permalink
feat: support to set an alternative image owner (#164)
Browse files Browse the repository at this point in the history
Co-authored-by: rick <LinuxSuRen@users.noreply.github.com>
  • Loading branch information
LinuxSuRen and LinuxSuRen committed Jan 25, 2023
1 parent ee7c498 commit 9860cde
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Expand Up @@ -41,6 +41,7 @@ jobs:
- name: goreleaser
run: |
echo "${{ github.token }}" | docker login https://ghcr.io -u ${GITHUB_ACTOR} --password-stdin
make release
GITHUB_ACTOR=$(echo ${GITHUB_ACTOR} | tr '[:upper:]' '[:lower:]')
GIT_OWNER=${GITHUB_ACTOR} make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 7 additions & 6 deletions .goreleaser.yml
Expand Up @@ -5,6 +5,7 @@ builds:
- CGO_ENABLED=0
- GOFLAGS = -mod=vendor
- GO111MODULE = on
- GIT_OWNER = yannh
goos:
- windows
- linux
Expand All @@ -31,18 +32,18 @@ archives:

dockers:
- image_templates:
- 'ghcr.io/yannh/kubeconform:latest'
- 'ghcr.io/yannh/kubeconform:{{ .Tag }}'
- 'ghcr.io/yannh/kubeconform:{{ .Tag }}-amd64'
- 'ghcr.io/{{.Env.GIT_OWNER}}/kubeconform:latest'
- 'ghcr.io/{{.Env.GIT_OWNER}}/kubeconform:{{ .Tag }}'
- 'ghcr.io/{{.Env.GIT_OWNER}}/kubeconform:{{ .Tag }}-amd64'
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
goos: linux
goarch: amd64
- image_templates:
- 'ghcr.io/yannh/kubeconform:latest-alpine'
- 'ghcr.io/yannh/kubeconform:{{ .Tag }}-alpine'
- 'ghcr.io/yannh/kubeconform:{{ .Tag }}-amd64-alpine'
- 'ghcr.io/{{.Env.GIT_OWNER}}/kubeconform:latest-alpine'
- 'ghcr.io/{{.Env.GIT_OWNER}}/kubeconform:{{ .Tag }}-alpine'
- 'ghcr.io/{{.Env.GIT_OWNER}}/kubeconform:{{ .Tag }}-amd64-alpine'
dockerfile: Dockerfile-alpine
build_flag_templates:
- "--platform=linux/amd64"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -35,7 +35,7 @@ goreleaser-build-static:
cp dist/kubeconform_linux_amd64_v1/kubeconform bin/

release:
docker run -e GITHUB_TOKEN -t -v /var/run/docker.sock:/var/run/docker.sock -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform goreleaser/goreleaser:v1.11.5 release --rm-dist
docker run -e GITHUB_TOKEN -e GIT_OWNER -t -v /var/run/docker.sock:/var/run/docker.sock -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform goreleaser/goreleaser:v1.11.5 release --rm-dist

update-deps:
go get -u ./...
Expand Down

0 comments on commit 9860cde

Please sign in to comment.