diff --git a/.github/workflows/_docker-build-push.yml b/.github/workflows/_docker-build-push.yml index 4bde5fb38..aaa23a0d8 100644 --- a/.github/workflows/_docker-build-push.yml +++ b/.github/workflows/_docker-build-push.yml @@ -16,6 +16,12 @@ on: service-name: required: true type: string + docker-context-path: + required: false + type: string + dockerfile-path: + required: false + type: string secrets: ARM_RUNNER_HOSTNAME: required: true @@ -71,8 +77,8 @@ jobs: - name: Build and push uses: docker/build-push-action@v6 with: - context: ${{ inputs.service-name }} - file: '${{ inputs.service-name }}/Dockerfile' + context: ${{ inputs.docker-context-path || format('{0}/Dockerfile', inputs.service-name) }} + file: ${{ inputs.dockerfile-path || format('{0}/Dockerfile', inputs.service-name) }} build-contexts: | proto=proto push: ${{ steps.tags_extractor.outputs.tags != '' }} @@ -80,6 +86,6 @@ jobs: platforms: | linux/amd64 linux/arm64/v8 - labels: ${{ steps.meta.outputs.labels }} + labels: ${{ steps.setup.outputs.docker-labels }} cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:build-cache cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}:build-cache,mode=max', env.IMAGE_NAME) || '' }} diff --git a/.github/workflows/bens.yml b/.github/workflows/bens.yml index f7afe4880..02af911a3 100644 --- a/.github/workflows/bens.yml +++ b/.github/workflows/bens.yml @@ -122,64 +122,21 @@ jobs: always() && (needs.test.result == 'success' || needs.test.result == 'cancelled') && (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 60 - runs-on: ubuntu-latest - outputs: - semver: ${{ steps.regex.outputs.group2 }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: actions-ecosystem/action-regex-match@v2 - id: regex - with: - text: ${{ github.ref }} - regex: '^(refs\/tags\/bens\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - - - name: Extract tag name - id: tags_extractor - run: | - t=${{ steps.regex.outputs.group2 }} - m=${{ steps.regex.outputs.group4 }} - (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: "blockscout-ens" - file: "blockscout-ens/Dockerfile" - build-contexts: | - proto=proto - push: ${{ steps.tags_extractor.outputs.tags != '' }} - tags: ${{ steps.tags_extractor.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache - cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} + uses: ./.github/workflows/_docker-build-push.yml + with: + service-name: blockscout-ens + secrets: + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} publish_types_package: name: Publish types package uses: './.github/workflows/npm-publisher.yml' needs: push - if: needs.push.outputs.semver != '' + if: needs.push.outputs.tag-value != '' secrets: inherit with: - version: ${{ needs.push.outputs.semver }} + version: ${{ needs.push.outputs.tag-value }} project_name: blockscout-ens push-swagger: diff --git a/.github/workflows/da-indexer.yml b/.github/workflows/da-indexer.yml index e2608c7e8..c734a3694 100644 --- a/.github/workflows/da-indexer.yml +++ b/.github/workflows/da-indexer.yml @@ -83,6 +83,9 @@ jobs: uses: ./.github/workflows/_docker-build-push.yml with: service-name: da-indexer + secrets: + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} push-swagger: if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) diff --git a/.github/workflows/eth-bytecode-db.yml b/.github/workflows/eth-bytecode-db.yml index dd510ee33..ce5240363 100644 --- a/.github/workflows/eth-bytecode-db.yml +++ b/.github/workflows/eth-bytecode-db.yml @@ -95,6 +95,9 @@ jobs: uses: ./.github/workflows/_docker-build-push.yml with: service-name: eth-bytecode-db + secrets: + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} push-swagger: if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) diff --git a/.github/workflows/multichain-aggregator.yml b/.github/workflows/multichain-aggregator.yml index eaf1a21ba..96eaae25f 100644 --- a/.github/workflows/multichain-aggregator.yml +++ b/.github/workflows/multichain-aggregator.yml @@ -78,6 +78,9 @@ jobs: uses: ./.github/workflows/_docker-build-push.yml with: service-name: multichain-aggregator + secrets: + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} push-swagger: if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) diff --git a/.github/workflows/multichain-search.yml b/.github/workflows/multichain-search.yml index 162f7c000..c9d38bf3c 100644 --- a/.github/workflows/multichain-search.yml +++ b/.github/workflows/multichain-search.yml @@ -96,47 +96,11 @@ jobs: always() && (needs.test.result == 'success' || needs.test.result == 'cancelled') && (needs.lint.result == 'success' || needs.lint.result == 'cancelled') - timeout-minutes: 30 - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: actions-ecosystem/action-regex-match@v2 - id: regex - with: - text: ${{ github.ref }} - regex: '^(refs\/tags\/multichain-search\/(v\d+\.\d+\.\d+))|(refs\/heads\/(main))$' - - - name: Extract tag name - id: tags_extractor - run: | - t=${{ steps.regex.outputs.group2 }} - m=${{ steps.regex.outputs.group4 }} - (if ! [[ "$t" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$t, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest; elif ! [[ "$m" == "" ]]; then echo tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$m; else echo tags=; fi) >> $GITHUB_OUTPUT - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: "multichain-search/backend" - file: "multichain-search/backend/Dockerfile" - push: ${{ steps.tags_extractor.outputs.tags != '' }} - tags: ${{ steps.tags_extractor.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build-cache - cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref={0}/{1}:build-cache,mode=max', env.REGISTRY, env.IMAGE_NAME) || '' }} + uses: ./.github/workflows/_docker-build-push.yml + with: + service-name: multichain-search + secrets: + docker-context-path: "multichain-search/backend" + dockerfile-path: "multichain-search/backend/Dockerfile" + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} diff --git a/.github/workflows/proxy-verifier.yml b/.github/workflows/proxy-verifier.yml index 4bf3cda78..2ab8a03c2 100644 --- a/.github/workflows/proxy-verifier.yml +++ b/.github/workflows/proxy-verifier.yml @@ -65,6 +65,9 @@ jobs: uses: ./.github/workflows/_docker-build-push.yml with: service-name: proxy-verifier + secrets: + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} push-swagger: if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) diff --git a/.github/workflows/sig-provider.yml b/.github/workflows/sig-provider.yml index 7b3fe9d29..40f0a6a84 100644 --- a/.github/workflows/sig-provider.yml +++ b/.github/workflows/sig-provider.yml @@ -65,6 +65,9 @@ jobs: uses: ./.github/workflows/_docker-build-push.yml with: service-name: sig-provider + secrets: + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} push-swagger: diff --git a/.github/workflows/smart-contract-verifier.yml b/.github/workflows/smart-contract-verifier.yml index b43692097..929dd0dca 100644 --- a/.github/workflows/smart-contract-verifier.yml +++ b/.github/workflows/smart-contract-verifier.yml @@ -65,6 +65,9 @@ jobs: uses: ./.github/workflows/_docker-build-push.yml with: service-name: smart-contract-verifier + secrets: + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} push-swagger: if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml index 1f91ed9bc..d3cead4fa 100644 --- a/.github/workflows/stats.yml +++ b/.github/workflows/stats.yml @@ -89,6 +89,9 @@ jobs: uses: ./.github/workflows/_docker-build-push.yml with: service-name: stats + secrets: + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} publish_types_package: name: Publish types package diff --git a/.github/workflows/stylus-verifier.yml b/.github/workflows/stylus-verifier.yml index 30cf2c744..9edfd067f 100644 --- a/.github/workflows/stylus-verifier.yml +++ b/.github/workflows/stylus-verifier.yml @@ -65,3 +65,6 @@ jobs: uses: ./.github/workflows/_docker-build-push.yml with: service-name: stylus-verifier + secrets: + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} diff --git a/.github/workflows/user-ops-indexer.yml b/.github/workflows/user-ops-indexer.yml index 8d2f7e4ea..9b46d4068 100644 --- a/.github/workflows/user-ops-indexer.yml +++ b/.github/workflows/user-ops-indexer.yml @@ -81,6 +81,9 @@ jobs: uses: ./.github/workflows/_docker-build-push.yml with: service-name: user-ops-indexer + secrets: + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} push-swagger: if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) diff --git a/.github/workflows/visualizer.yml b/.github/workflows/visualizer.yml index f537c4128..6830e19f0 100644 --- a/.github/workflows/visualizer.yml +++ b/.github/workflows/visualizer.yml @@ -74,6 +74,9 @@ jobs: uses: ./.github/workflows/_docker-build-push.yml with: service-name: visualizer + secrets: + ARM_RUNNER_HOSTNAME: ${{ secrets.ARM_RUNNER_HOSTNAME }} + ARM_RUNNER_KEY: ${{ secrets.ARM_RUNNER_KEY }} publish_types_package: name: Publish types package