From f00d5db69c96a4a9bbef15bf00a1a6fc6a242ae5 Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Sun, 8 Dec 2024 09:08:31 +0000 Subject: [PATCH] Update --- .github/workflows/build_docker.yaml | 13 +++++++++++-- .github/workflows/push_to_cnb.yaml | 30 ----------------------------- 2 files changed, 11 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/push_to_cnb.yaml diff --git a/.github/workflows/build_docker.yaml b/.github/workflows/build_docker.yaml index 673fe1fa..9849dbbb 100644 --- a/.github/workflows/build_docker.yaml +++ b/.github/workflows/build_docker.yaml @@ -24,7 +24,14 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and push Docker image + - name: Login to CNB Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CNB_DOCKER_REGISTRY }} + username: cnb + password: 34hs1c6a15KgJOVTQ1tGa9AyU3A + + - name: Build and push Docker images uses: docker/build-push-action@v4 with: context: . @@ -32,4 +39,6 @@ jobs: platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/riscv64 # linux/mips,linux/mipsle 暂不支持 alpine, linux/s390x 编译卡死 push: true - tags: ${{ secrets.DOCKER_USERNAME }}/goecs:latest + tags: | + ${{ secrets.DOCKER_USERNAME }}/goecs:latest + ${{ secrets.CNB_DOCKER_REGISTRY }}/${{ github.repository }}:latest diff --git a/.github/workflows/push_to_cnb.yaml b/.github/workflows/push_to_cnb.yaml deleted file mode 100644 index 19576b36..00000000 --- a/.github/workflows/push_to_cnb.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Push to CNB - -on: - push: - branches: - - master - workflow_dispatch: - -jobs: - push-to-cnb: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Import to CNB - run: | - docker run --rm \ - -e PLUGIN_SOURCE_TOKEN="${{ secrets.GITHUB_TOKEN }}" \ - -e PLUGIN_SOURCE_URL="https://github.com" \ - -e PLUGIN_SOURCE_PLATFORM="github" \ - -e PLUGIN_SOURCE_REPO="oneclickvirt/ecs" \ - -e PLUGIN_CNB_ROOT_ORGANIZATION="oneclickvirt" \ - -e PLUGIN_CNB_TOKEN="${{ secrets.CNB_TOKEN }}" \ - -e PLUGIN_CNB_URL="https://cnb.cool" \ - -e PLUGIN_MIGRATE_FORCE_PUSH="true" \ - -e PLUGIN_MIGRATE_LOG_LEVEL="debug" \ - -v ${{ github.workspace }}:${{ github.workspace }} \ - -w ${{ github.workspace }} \ - cnbcool/code-import \ No newline at end of file