From 65fdc955f625724501fa8547ac38312bdccaacfc Mon Sep 17 00:00:00 2001 From: liujian <54946465+redscholar@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:49:53 +0800 Subject: [PATCH] fix: sync image to aliyuns repo --- .github/workflows/release.yml | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7608a702b32..144394dde5c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,11 +5,6 @@ on: - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 name: Build Release -env: - # TODO: Change variable to your image's name. - IMAGE_NAME: ks-console - IMAGE_REPO: kubesphere - jobs: release-linux-amd64: runs-on: ubuntu-latest @@ -17,6 +12,20 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Login to Aliyun + uses: docker/login-action@v3 + with: + registry: registry.cn-beijing.aliyuncs.com + username: ${{ secrets.ALIYUNCS_USERNAME }} + password: ${{ secrets.ALIYUNCS_PASSWORD }} + + - name: Login to DOCKER + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Set up QEMU uses: docker/setup-qemu-action@v1 with: @@ -25,10 +34,12 @@ jobs: - name: Set up Docker buildx uses: docker/setup-buildx-action@v1 - - name: Log into registry - run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - - name: Push image run: | - TAG=${GITHUB_REF#refs/*/} REPO=$IMAGE_REPO make container-cross-push - echo "Push $IMAGE success!" + tag=${GITHUB_REF#refs/*/} + if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + REPO=docker.io/kubesphere TAG=$tag make container-cross-push + REPO=registry.cn-beijing.aliyuncs.com/kubesphereio TAG=$tag make container-cross-push + else + REPO=docker.io/kubespheredev TAG=$tag make container-cross-push + fi