diff --git a/.github/workflows/publish-canary.yml b/.github/workflows/publish-canary.yml index a466f557d66ef..d534280c3a24f 100644 --- a/.github/workflows/publish-canary.yml +++ b/.github/workflows/publish-canary.yml @@ -24,9 +24,10 @@ jobs: hardhat-node: ${{ steps.packages.outputs.hardhat-node }} canary-docker-tag: ${{ steps.docker-image-name.outputs.canary-docker-tag }} proxyd: ${{ steps.packages.outputs.proxyd }} - op-exporter : ${{ steps.packages.outputs.op-exporter }} - l2geth-exporter : ${{ steps.packages.outputs.l2geth-exporter }} - batch-submitter-service : ${{ steps.packages.outputs.batch-submitter-service }} + op-exporter: ${{ steps.packages.outputs.op-exporter }} + l2geth-exporter: ${{ steps.packages.outputs.l2geth-exporter }} + batch-submitter-service: ${{ steps.packages.outputs.batch-submitter-service }} + indexer: ${{ steps.packages.outputs.indexer }} steps: - name: Check out source code @@ -438,3 +439,40 @@ jobs: file: ./ops/docker/Dockerfile.batch-submitter-service push: true tags: ethereumoptimism/batch-submitter-service:${{ needs.canary-publish.outputs.batch-submitter-service }} + + indexer: + name: Publish indexer Version ${{ needs.canary-publish.outputs.canary-docker-tag }} + needs: canary-publish + if: needs.canary-publish.outputs.indexer != '' + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }} + password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }} + + - name: Set build args + id: build_args + run: | + echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" + echo ::set-output name=GITVERSION::$(jq -r .version ./go/indexer/package.json) + echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./ops/docker/Dockerfile.indexer + push: true + tags: ethereumoptimism/batch-submitter-service:${{ needs.canary-publish.outputs.indexer }} + build-args: | + GITDATE=${{ steps.build_args.outputs.GITDATE }} + GITCOMMIT=${{ steps.build_args.outputs.GITCOMMIT }} + GITVERSION=${{ steps.build_args.outputs.GITVERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52cb989375cd6..788547c26fc05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,9 +19,10 @@ jobs: replica-healthcheck: ${{ steps.packages.outputs.replica-healthcheck }} proxyd: ${{ steps.packages.outputs.proxyd }} hardhat-node: ${{ steps.packages.outputs.hardhat-node }} - op-exporter : ${{ steps.packages.outputs.op-exporter }} - l2geth-exporter : ${{ steps.packages.outputs.l2geth-exporter }} - batch-submitter-service : ${{ steps.packages.outputs.batch-submitter-service }} + op-exporter: ${{ steps.packages.outputs.op-exporter }} + l2geth-exporter: ${{ steps.packages.outputs.l2geth-exporter }} + batch-submitter-service: ${{ steps.packages.outputs.batch-submitter-service }} + indexer: ${{ steps.packages.outputs.indexer }} steps: - name: Checkout Repo @@ -416,3 +417,40 @@ jobs: file: ./ops/docker/Dockerfile.batch-submitter-service push: true tags: ethereumoptimism/batch-submitter-service:${{ needs.release.outputs.batch-submitter-service }},ethereumoptimism/batch-submitter-service:latest + + indexer: + name: Publish Indexer Version ${{ needs.release.outputs.indexer }} + needs: release + if: needs.release.outputs.indexer != '' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }} + password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Set build args + id: build_args + run: | + echo ::set-output name=GITDATE::"$(date +%d-%m-%Y)" + echo ::set-output name=GITVERSION::$(jq -r .version ./go/indexer/package.json) + echo ::set-output name=GITCOMMIT::"$GITHUB_SHA" + + - name: Publish Indexer + uses: docker/build-push-action@v2 + with: + context: . + file: ./ops/docker/Dockerfile.indexer + push: true + tags: ethereumoptimism/indexer:${{ needs.release.outputs.indexer }},ethereumoptimism/indexer:latest + build-args: | + GITDATE=${{ steps.build_args.outputs.GITDATE }} + GITCOMMIT=${{ steps.build_args.outputs.GITCOMMIT }} + GITVERSION=${{ steps.build_args.outputs.GITVERSION }}