diff --git a/.github/workflows/release-tools.yaml b/.github/workflows/release-tools.yaml index 8ac4b4bd..1adf610f 100644 --- a/.github/workflows/release-tools.yaml +++ b/.github/workflows/release-tools.yaml @@ -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 }} diff --git a/tools/Makefile b/tools/Makefile index 7bf0c965..9553c106 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -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 diff --git a/tools/README.md b/tools/README.md index 9239d49c..846e1ade 100644 --- a/tools/README.md +++ b/tools/README.md @@ -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. diff --git a/tools/RELEASE.md b/tools/RELEASE.md index 74d04dda..1abcf839 100644 --- a/tools/RELEASE.md +++ b/tools/RELEASE.md @@ -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