From 19840b83c47665ff88ab35796ad310572e65a249 Mon Sep 17 00:00:00 2001 From: yixinglu <2520865+yixinglu@users.noreply.github.com> Date: Sun, 4 Feb 2024 18:23:00 +0800 Subject: [PATCH 1/2] Replace the habor registery with docker --- .github/workflows/docker.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0430a7f..6ad61ad 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -43,20 +43,18 @@ jobs: run: | echo "TAG=$(echo ${{ matrix.os }} | tr -d '-')" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 - uses: docker/login-action@v2 with: - registry: ${{ secrets.HARBOR_REGISTRY }} - username: ${{ secrets.HARBOR_USERNAME }} - password: ${{ secrets.HARBOR_PASSWORD }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - uses: docker/build-push-action@v4 with: context: . file: ./docker/buildx/${{ matrix.os }}.Dockerfile platforms: linux/${{ matrix.arch }} tags: | - ${{ secrets.HARBOR_REGISTRY }}/vesoft/third-party-build:${{ steps.vars.outputs.TAG }}-${{ matrix.arch }} + vesoft/third-party-build:${{ steps.vars.outputs.TAG }}-${{ matrix.arch }} cache-to: type=local,dest=/tmp/buildx-cache,mode=max push: true @@ -78,13 +76,12 @@ jobs: - uses: docker/setup-buildx-action@v2 - uses: docker/login-action@v2 with: - registry: ${{ secrets.HARBOR_REGISTRY }} - username: ${{ secrets.HARBOR_USERNAME }} - password: ${{ secrets.HARBOR_PASSWORD }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - name: Create and push manifest env: DOCKER_CLI_EXPERIMENTAL: enabled - IMAGE: ${{ secrets.HARBOR_REGISTRY }}/vesoft/third-party-build:${{ matrix.os }} + IMAGE: vesoft/third-party-build:${{ matrix.os }} run: | docker manifest create $IMAGE --amend $IMAGE-amd64 --amend $IMAGE-arm64 docker manifest push $IMAGE From de21ddca73a881bc3a30c595d1a98678f9b69c89 Mon Sep 17 00:00:00 2001 From: yixinglu <2520865+yixinglu@users.noreply.github.com> Date: Sun, 4 Feb 2024 18:41:02 +0800 Subject: [PATCH 2/2] Use github action runner --- .github/workflows/docker.yml | 49 ++++-------------------------------- 1 file changed, 5 insertions(+), 44 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6ad61ad..56e2422 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -18,70 +18,31 @@ defaults: jobs: docker: - runs-on: - - self-hosted - - ${{ matrix.arch }} + runs-on: ubuntu-latest strategy: fail-fast: false matrix: os: - centos-7 - centos-8 - #- ubuntu-1604 - #- ubuntu-1804 - ubuntu-2004 - ubuntu-2204 - arch: - - amd64 - - arm64 steps: - - uses: webiny/action-post-run@3.0.0 - with: - run: sh -c "find . -mindepth 1 -delete" - name: Setup environment variables id: vars run: | echo "TAG=$(echo ${{ matrix.os }} | tr -d '-')" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - - uses: docker/setup-buildx-action@v2 - uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 - uses: docker/build-push-action@v4 with: context: . file: ./docker/buildx/${{ matrix.os }}.Dockerfile - platforms: linux/${{ matrix.arch }} - tags: | - vesoft/third-party-build:${{ steps.vars.outputs.TAG }}-${{ matrix.arch }} - cache-to: type=local,dest=/tmp/buildx-cache,mode=max + platforms: linux/amd64,linux/arm64 + tags: vesoft/third-party-build:${{ steps.vars.outputs.TAG }} push: true - - manifest: - needs: docker - runs-on: - - self-hosted - strategy: - fail-fast: false - matrix: - os: - - centos7 - - centos8 - #- ubuntu1604 - #- ubuntu1804 - - ubuntu2004 - - ubuntu2204 - steps: - - uses: docker/setup-buildx-action@v2 - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Create and push manifest - env: - DOCKER_CLI_EXPERIMENTAL: enabled - IMAGE: vesoft/third-party-build:${{ matrix.os }} - run: | - docker manifest create $IMAGE --amend $IMAGE-amd64 --amend $IMAGE-arm64 - docker manifest push $IMAGE