From ad45e6a09633655300f02bdb01981cab9c2a45d6 Mon Sep 17 00:00:00 2001 From: "John McClure (pickleback)" Date: Tue, 28 May 2024 16:42:14 -0500 Subject: [PATCH] Create mainnet_fork_docker.yml --- .github/workflows/mainnet_fork_docker.yml | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/mainnet_fork_docker.yml diff --git a/.github/workflows/mainnet_fork_docker.yml b/.github/workflows/mainnet_fork_docker.yml new file mode 100644 index 000000000..db5cac18a --- /dev/null +++ b/.github/workflows/mainnet_fork_docker.yml @@ -0,0 +1,57 @@ +name: Publish the mainnet fork image + +on: + workflow_dispatch: + push: + branches: + - "main" + tags: + - "v*" + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }}/mainnet_fork + +jobs: + push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Log in to the Container registry + uses: docker/login-action@v2.2.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4.5.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + # Add a tag matching the commit hash + type=sha,format=long,prefix= + # Add a version tag when a valid semver tag is pushed. + type=semver,pattern={{version}} + # Add the edge tag to represent the latest commit to main + type=raw,value=edge,enable={{is_default_branch}} + + - name: Build and push the mainnet fork image + uses: docker/build-push-action@v4.1.0 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + ADMIN=${{ vars.DEVNET_ADMIN }} + DEPLOYER_PRIVATE_KEY=${{ vars.DEVNET_ADMIN_PRIVATE_KEY }} + MAINNET_RPC_URL=${{ secrets.MAINNET_RPC_URL }}