Skip to content

Commit

Permalink
fix #319: upload docker images to ghcr.io as well
Browse files Browse the repository at this point in the history
  • Loading branch information
KEINOS committed Apr 10, 2024
1 parent f4e6404 commit a752f96
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Login to GitHub Container Registry before push.
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GO_RELEASER_TOKEN }}

# Build and release
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
Expand Down
24 changes: 23 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ brews:
dockers:
- image_templates:
- "ikawaha/kagome:{{ .Version }}-amd64"
- "ghcr.io/ikawaha/kagome:{{ .Version }}-amd64"
use: buildx
goarch: amd64
dockerfile: Dockerfile
Expand All @@ -78,6 +79,7 @@ dockers:

- image_templates:
- "ikawaha/kagome:{{ .Version }}-arm64"
- "ghcr.io/ikawaha/kagome:{{ .Version }}-arm64"
use: buildx
goarch: arm64
dockerfile: Dockerfile
Expand All @@ -86,6 +88,7 @@ dockers:

- image_templates:
- "ikawaha/kagome:{{ .Version }}-arm32v5"
- "ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v5"
use: buildx
goarch: arm
goarm: 5
Expand All @@ -95,6 +98,7 @@ dockers:

- image_templates:
- "ikawaha/kagome:{{ .Version }}-arm32v6"
- "ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v6"
use: buildx
goarch: arm
goarm: 6
Expand All @@ -104,6 +108,7 @@ dockers:

- image_templates:
- "ikawaha/kagome:{{ .Version }}-arm32v7"
- "ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v7"
use: buildx
goarch: arm
goarm: 7
Expand All @@ -114,6 +119,7 @@ dockers:
# Create multiarch manifest file of Docker image. This will bind all the images
# above into a single manifest file for "latest" and each version tag.
docker_manifests:
# Manifest for Docker Hub
- name_template: ikawaha/kagome:{{ .Version }}
image_templates:
- ikawaha/kagome:{{ .Version }}-amd64
Expand All @@ -127,4 +133,20 @@ docker_manifests:
- ikawaha/kagome:{{ .Version }}-arm64
- ikawaha/kagome:{{ .Version }}-arm32v5
- ikawaha/kagome:{{ .Version }}-arm32v6
- ikawaha/kagome:{{ .Version }}-arm32v7
- ikawaha/kagome:{{ .Version }}-arm32v7

# Manifest for GitHub Container Registry
- name_template: ghcr.io/ikawaha/kagome:{{ .Version }}
image_templates:
- ghcr.io/ikawaha/kagome:{{ .Version }}-amd64
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm64
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v5
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v6
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v7
- name_template: ghcr.io/ikawaha/kagome:latest
image_templates:
- ghcr.io/ikawaha/kagome:{{ .Version }}-amd64
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm64
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v5
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v6
- ghcr.io/ikawaha/kagome:{{ .Version }}-arm32v7
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,25 @@ A debug tool of tokenize process outputs a lattice in graphviz dot format.
```sh
# Compatible architectures: AMD64, Arm64, Arm32 (Arm v5, v6 and v7)
docker pull ikawaha/kagome:latest

# Alternatively, you can pull from GitHub Container Registry
docker pull ghcr.io/ikawaha/kagome:latest
```

```sh
# Interactive/REPL mode
docker run --rm -it ikawaha/kagome:latest

# If pulling from GitHub Container Registry
docker run --rm -it ghcr.io/ikawaha/kagome:latest
```

```sh
# Server mode (http://localhost:6060)
docker run --rm -p 6060:6060 ikawaha/kagome:latest server

# If pulling from GitHub Container Registry
docker run --rm -p 6060:6060 ghcr.io/ikawaha/kagome:latest server
```

# Building to WebAssembly
Expand Down

0 comments on commit a752f96

Please sign in to comment.