Skip to content

Commit

Permalink
Merge pull request #682 from cybozu-go/cke-tools-ghcr
Browse files Browse the repository at this point in the history
cke-tools: Migrate to ghcr.io
  • Loading branch information
masa213f authored Dec 4, 2023
2 parents f1148e0 + 21b4b4b commit 65b7c01
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/release-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@ jobs:
run: |
cd tools
make all
- name: Push cke-tools image to Quay.io
run: |
echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USER }} --password-stdin quay.io
TAG=quay.io/cybozu/cke-tools:${GITHUB_REF#refs/tags/tools-}
docker build --no-cache -t $TAG tools
docker push $TAG
- name: Extract tag
id: extract-tag
run: echo "tag=${GITHUB_REF#refs/tags/tools-}" >> $GITHUB_OUTPUT
- name: Log in to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push cke-tools
uses: docker/build-push-action@v5
with:
context: ./tools
push: true
platforms: linux/amd64
tags: ghcr.io/${{ github.repository_owner }}/cke-tools:${{ steps.extract-tag.outputs.tag }}
labels: org.opencontainers.image.source=https://github.com/${{ github.repository }}
2 changes: 1 addition & 1 deletion tools/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CNI_PLUGIN_VERSION = 1.3.0
TAG = quay.io/cybozu/cke-tools:dev
TAG = ghcr.io/cybozu-go/cke-tools:dev
GOBUILD = CGO_ENABLED=0 go build -ldflags="-w -s"

.PHONY: all
Expand Down
2 changes: 1 addition & 1 deletion tools/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This directory contains source code to build `cke-tools`, a helper container for CKE.

The container image is pushed to [quay.io/cybozu/cke-tools](https://quay.io/repository/cybozu/cke-tools) by GitHub Actions.
The container image is pushed to [ghcr.io/cybozu-go/cke-tools](https://github.com/cybozu-go/cke/pkgs/container/cke-tools) by GitHub Actions.

See [RELEASE.md](RELEASE.md) for how to push a new image version.
2 changes: 1 addition & 1 deletion tools/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ The patch version is increased with `cke-tools` update.
$ git push origin "tools-$VERSION"
```

GitHub Actions will build and push the new image as `quay.io/cybozu/cke-tools:X.Y.Z`.
GitHub Actions will build and push the new image as `ghcr.io/cybozu-go/cke-tools:X.Y.Z`.

[semver]: https://semver.org/spec/v2.0.0.html

0 comments on commit 65b7c01

Please sign in to comment.