From 21b4b4beb2168d4a544a35f2693baeb41189ca77 Mon Sep 17 00:00:00 2001 From: Masayuki Ishii Date: Mon, 4 Dec 2023 07:35:35 +0000 Subject: [PATCH] cke-tools: Migrate to ghcr.io Signed-off-by: Masayuki Ishii --- .github/workflows/release-tools.yaml | 23 +++++++++++++++++------ tools/Makefile | 2 +- tools/README.md | 2 +- tools/RELEASE.md | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-tools.yaml b/.github/workflows/release-tools.yaml index 8ac4b4bd4..1adf610f0 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 7bf0c9652..9553c106c 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 9239d49ce..846e1ade7 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 74d04dda9..1abcf839a 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