From 2a5d1f19543c7015edcf5263fe79caf43ce1e74d Mon Sep 17 00:00:00 2001 From: keylogic1 <119584546+keylogic1@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:22:57 +0300 Subject: [PATCH 1/6] Test global buildkit --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dfa3ef82..91e5438bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,13 +4,17 @@ on: push: branches: - "main" + - "chore/fix-ci" pull_request: branches: - "main" + - "chore/fix-ci" jobs: docker: runs-on: self-hosted + env: + DOCKER_BUILDKIT: 1 steps: - name: Checkout From ba302b97a860aa0bc5ed589c08d8cbe1e35af54d Mon Sep 17 00:00:00 2001 From: keylogic1 <119584546+keylogic1@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:28:52 +0300 Subject: [PATCH 2/6] Test II --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91e5438bd..cf6c4a889 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,12 @@ jobs: run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - name: Set up Docker Buildx - run: docker buildx create --use --driver cloud "neutronorg/neutron" + uses: docker/setup-buildx-action@v3 + with: + version: "lab:latest" + driver: cloud + endpoint: "neutronorg/neutron" + install: true - name: Build and push Docker image env: From a072b6c82517e8efe321bdc3f0a5b6a8b08a0233 Mon Sep 17 00:00:00 2001 From: keylogic1 <119584546+keylogic1@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:38:00 +0300 Subject: [PATCH 3/6] Test III --- .github/workflows/ci.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf6c4a889..8898b9082 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: - name: Get version from git tags id: get_version - run: echo "VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> $GITHUB_ENV + run: echo "VERSION=v$(git describe --tags --abbrev=0 | sed 's/^v//')" >> $GITHUB_ENV - name: Log in to Docker Hub run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin @@ -57,13 +57,23 @@ jobs: endpoint: "neutronorg/neutron" install: true - - name: Build and push Docker image - env: - VERSION: ${{ env.VERSION }} - run: | - DOCKER_BUILDKIT=1 make build-static-linux-amd64 - docker tag neutron-amd64:latest neutronorg/neutron:${{ env.VERSION }} - docker push neutronorg/neutron:${{ env.VERSION }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile.builder + tags: "${{ env.VERSION }}" + # For pull requests, export results to the build cache. + # Otherwise, push to a registry. + outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} + +# - name: Build and push Docker image +# env: +# VERSION: ${{ env.VERSION }} +# run: | +# DOCKER_BUILDKIT=1 make build-static-linux-amd64 +# docker tag neutron-amd64:latest neutronorg/neutron:${{ env.VERSION }} +# docker push neutronorg/neutron:${{ env.VERSION }} - name: Cleanup temporary container run: docker rm -f neutronbinary || true From 09442e7a842629e42be87d13765f09d5a3fbcfe6 Mon Sep 17 00:00:00 2001 From: keylogic1 <119584546+keylogic1@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:42:40 +0300 Subject: [PATCH 4/6] Test IV --- .github/workflows/ci.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8898b9082..b5ffa9d8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,23 +57,24 @@ jobs: endpoint: "neutronorg/neutron" install: true - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.builder - tags: "${{ env.VERSION }}" - # For pull requests, export results to the build cache. - # Otherwise, push to a registry. - outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} +# - name: Build and push +# uses: docker/build-push-action@v5 +# with: +# context: . +# file: Dockerfile.builder +# tags: "${{ env.VERSION }}" +# # For pull requests, export results to the build cache. +# # Otherwise, push to a registry. +# outputs: ${{ github.event_name == 'pull_request' && 'type=cacheonly' || 'type=registry,push=true' }} -# - name: Build and push Docker image -# env: -# VERSION: ${{ env.VERSION }} -# run: | -# DOCKER_BUILDKIT=1 make build-static-linux-amd64 -# docker tag neutron-amd64:latest neutronorg/neutron:${{ env.VERSION }} -# docker push neutronorg/neutron:${{ env.VERSION }} + - name: Build and push Docker image + env: + VERSION: ${{ env.VERSION }} + run: | + docker buildx use neutronorg/neutron + make build-static-linux-amd64 + docker tag neutron-amd64:latest neutronorg/neutron:${{ env.VERSION }} + docker push neutronorg/neutron:${{ env.VERSION }} - name: Cleanup temporary container run: docker rm -f neutronbinary || true From 29f5ed243e4b209fff01cb8cab81fdc26274253a Mon Sep 17 00:00:00 2001 From: keylogic1 <119584546+keylogic1@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:45:19 +0300 Subject: [PATCH 5/6] Test V --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5ffa9d8a..50e163d19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: env: VERSION: ${{ env.VERSION }} run: | - docker buildx use neutronorg/neutron + docker buildx use neutron make build-static-linux-amd64 docker tag neutron-amd64:latest neutronorg/neutron:${{ env.VERSION }} docker push neutronorg/neutron:${{ env.VERSION }} From 21c127089bacccd06a0d1343a7a7ee9e64ee4f94 Mon Sep 17 00:00:00 2001 From: keylogic1 <119584546+keylogic1@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:49:34 +0300 Subject: [PATCH 6/6] Test VI --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50e163d19..041d09da4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,7 @@ jobs: run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - name: Set up Docker Buildx + id: buildx uses: docker/setup-buildx-action@v3 with: version: "lab:latest" @@ -70,8 +71,9 @@ jobs: - name: Build and push Docker image env: VERSION: ${{ env.VERSION }} + BUILDER: ${{ steps.buildx.outputs.name }} run: | - docker buildx use neutron + docker buildx use $BUILDER make build-static-linux-amd64 docker tag neutron-amd64:latest neutronorg/neutron:${{ env.VERSION }} docker push neutronorg/neutron:${{ env.VERSION }}