Skip to content

Commit

Permalink
Add support to publish docker images to ghcr over dockerhub
Browse files Browse the repository at this point in the history
Update the goreleaser config to point to ghcr
  • Loading branch information
nikhilsbhat committed Aug 7, 2023
1 parent 029a940 commit d49d4f0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ dockers:
- gocd-cli
skip_push: false
image_templates:
- "basnik/gocd-cli:latest"
- "basnik/gocd-cli:{{ .Tag }}"
- "basnik/gocd-cli:{{ .Tag }}-{{ .Env.GOVERSION }}"
- "ghcr.io/nikhilsbhat/gocd-cli:latest"
- "ghcr.io/nikhilsbhat/gocd-cli:{{ .Tag }}"
- "ghcr.io/nikhilsbhat/gocd-cli:{{ .Tag }}-{{ .Env.GOVERSION }}"
dockerfile: Dockerfile

archives:
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,7 @@ generate.document: ## generates cli documents using 'github.com/spf13/cobra/doc'
@go generate github.com/nikhilsbhat/gocd-cli/docs

test: ## runs test cases
@go test ./... -mod=vendor -coverprofile cover.out && go tool cover -html=cover.out -o cover.html && open cover.html
@go test ./... -mod=vendor -coverprofile cover.out && go tool cover -html=cover.out -o cover.html && open cover.html

docker.login: ## Should login to ghcr docker registry.
@echo "${GITHUB_TOKEN}" | docker login ghcr.io -u nikshilsbhat --password-stdin
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ Updated documentation on all available commands and flags can be found [here](ht
* Recommend installing released versions. Release binaries are available on the [releases](https://github.com/nikhilsbhat/gocd-cli/releases) page and docker from [here](https://hub.docker.com/repository/docker/basnik/gocd-cli).
* Can always build it locally by running `go build` against cloned repo.

#### Docker

Latest version of docker images are published to [ghcr.io](https://github.com/nikhilsbhat/gocd-cli/pkgs/container/gocd-cli), all available images can be found there. </br>

```bash
docker pull ghcr.io/nikhilsbhat/gocd-cli:latest
docker pull ghcr.io/nikhilsbhat/gocd-cli:<github-release-tag>
```

### Note

* The command `gocd-cli pipeline validate-syntax` would use GoCD's plugin binary to validate the pipeline syntax.
Expand Down

0 comments on commit d49d4f0

Please sign in to comment.