diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 18e5170..63782ba 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -65,14 +65,6 @@ jobs: uses: docker/setup-buildx-action@v3 id: buildx - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-v1.0-service-node-${{ matrix.arch }}-${{ github.ref_name }} - restore-keys: | - ${{ runner.os }}-buildx-v1.0-service-node-${{ matrix.arch }}- - - name: Check docker config and disable live reload run: | cat /etc/docker/daemon.json @@ -106,8 +98,7 @@ jobs: - name: Build and load run: | mkdir export - make docker-build ARGS='--set "*.cache-from=type=local,src=/tmp/.buildx-cache" \ - --set "*.cache-to=type=local,dest=/tmp/.buildx-cache-new" \ + make docker-build ARGS='--set "*.cache-from=type=gha" \ --set "*.platform=linux/${{ matrix.arch }}" \ --builder ${{ steps.buildx.outputs.name }} \ --set "app.output=type=tar,dest=export/app.tar" \ @@ -133,11 +124,6 @@ jobs: timeout 1 make docker-logs || true working-directory: ethereum-contracts - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache - - name: Upload artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/docker-vulnerabilities.yaml b/.github/workflows/docker-vulnerabilities.yaml index 28e0d87..5a847d0 100644 --- a/.github/workflows/docker-vulnerabilities.yaml +++ b/.github/workflows/docker-vulnerabilities.yaml @@ -48,18 +48,10 @@ jobs: uses: docker/setup-buildx-action@v3 id: buildx - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-trivy-service-node-${{ matrix.arch }}-${{ github.ref_name }} - restore-keys: | - ${{ runner.os }}-trivy-service-node-${{ matrix.arch }}- - name: Build and load run: | docker buildx bake \ - --set "*.cache-from=type=local,src=/tmp/.buildx-cache" \ - --set "*.cache-to=type=local,dest=/tmp/.buildx-cache-new" \ + --set "*.cache-from=type=gha" \ --set "*.platform=linux/${{ matrix.arch }}" \ --builder ${{ steps.buildx.outputs.name }} \ -f docker-compose.yml \ @@ -98,9 +90,3 @@ jobs: with: category: 'service-node-worker-${{ matrix.arch }}' sarif_file: 'trivy-worker-results.sarif' - - - name: Move cache - if: always() - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 773d3ef..fa6f42f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -19,6 +19,7 @@ jobs: with: tag: development environment: main + cache_enabled: true test: needs: publish-docker diff --git a/.github/workflows/publish-docker.yaml b/.github/workflows/publish-docker.yaml index 274cb58..c8a0942 100644 --- a/.github/workflows/publish-docker.yaml +++ b/.github/workflows/publish-docker.yaml @@ -15,6 +15,11 @@ on: required: false type: string default: "" + cache_enabled: + description: 'Enable caching' + required: false + type: boolean + default: false secrets: DOCKERHUB_USERNAME: description: 'Docker Hub username' @@ -46,14 +51,6 @@ jobs: uses: docker/setup-buildx-action@v3 id: buildx - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-to-publish-service-node-${{ matrix.arch }}-${{ github.ref_name }} - restore-keys: | - ${{ runner.os }}-to-publish-service-node-${{ matrix.arch }}- - - uses: actions/download-artifact@v4 with: merge-multiple: true @@ -87,8 +84,8 @@ jobs: export EXTRA_TAG=$DOCKER_TAG fi docker buildx bake \ - --set "*.cache-from=type=local,src=/tmp/.buildx-cache" \ - --set "*.cache-to=type=local,dest=/tmp/.buildx-cache-new" \ + --set "*.cache-from=type=gha" \ + ${{ inputs.cache_enabled && '--set "*.cache-to=type=gha,mode=max" \' || '' }} --set "*.platform=linux/amd64" \ --builder ${{ steps.buildx.outputs.name }} \ --sbom=true \ @@ -116,8 +113,3 @@ jobs: env: DOCKER_TAG: ${{ inputs.tag }} COSIGN_EXPERIMENTAL: "true" - - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/service-node-config.yml b/service-node-config.yml index 4b6db7b..a32e0c6 100644 --- a/service-node-config.yml +++ b/service-node-config.yml @@ -213,7 +213,7 @@ blockchains: - !ENV ${SONIC_FALLBACK_PROVIDER:https://rpc.blaze.soniclabs.com} average_block_time: !ENV tag:yaml.org,2002:int ${SONIC_AVERAGE_BLOCK_TIME:1} provider_timeout: !ENV tag:yaml.org,2002:int ${SONIC_PROVIDER_TIMEOUT:100} - chain_id: !ENV tag:yaml.org,2002:int ${SONIC_CHAIN_ID:64165} + chain_id: !ENV tag:yaml.org,2002:int ${SONIC_CHAIN_ID:57054} hub: !ENV ${SONIC_HUB:} forwarder: !ENV ${SONIC_FORWARDER:} pan_token: !ENV ${SONIC_PAN_TOKEN:}