Skip to content

Commit

Permalink
Merge pull request #122 from Consensys/feat/poh-verifier-mainnet-ci
Browse files Browse the repository at this point in the history
feat: added testnet and mainnet build/publish actions
  • Loading branch information
Julink-eth authored May 4, 2024
2 parents 57781ac + 5cff38c commit 00c8b2c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 12 deletions.
41 changes: 31 additions & 10 deletions .github/workflows/poh-verifier-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,25 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set Docker Tag
id: docker-tag
- name: Set Docker Tag Tesnet
id: docker-tag-testnet
if: ${{ github.event_name != 'release' }}
run: echo "DOCKER_TAG=${GITHUB_SHA:0:7}-$(date +%s)-poh-verifier" | tee $GITHUB_ENV
run: echo "DOCKER_TAG_TESTNET=${GITHUB_SHA:0:7}-$(date +%s)-poh-verifier-testnet" | tee $GITHUB_ENV

- name: Set Docker Tag - Release
id: docker-tag-release
- name: Set Docker Tag Mainnet
id: docker-tag-mainnet
if: ${{ github.event_name != 'release' }}
run: echo "DOCKER_TAG_MAINNET=${GITHUB_SHA:0:7}-$(date +%s)-poh-verifier-mainnet" | tee $GITHUB_ENV

- name: Set Docker Tag Testnet - Release
id: docker-tag-testnet-release
if: ${{ github.event_name == 'release' }}
run: echo "DOCKER_TAG_TESTNET=${GITHUB_SHA:0:7}-$(date +%s)-poh-verifier-testnet-${GITHUB_REF#refs/tags/}" | tee $GITHUB_ENV

- name: Set Docker Tag Mainnet - Release
id: docker-tag-mainnet-release
if: ${{ github.event_name == 'release' }}
run: echo "DOCKER_TAG=${GITHUB_SHA:0:7}-$(date +%s)-poh-verifier-${GITHUB_REF#refs/tags/}" | tee $GITHUB_ENV
run: echo "DOCKER_TAG_MAINNET=${GITHUB_SHA:0:7}-$(date +%s)-poh-verifier-mainnet-${GITHUB_REF#refs/tags/}" | tee $GITHUB_ENV

- name: Login to Docker Repository
uses: docker/login-action@v2
Expand All @@ -41,13 +51,24 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker Image Build and Publish
- name: Docker Image Build and Publish Testnet
uses: docker/build-push-action@v4
with:
build-args: |
ENV_FILE=.env.testnet
SIGNER_PRIVATE_KEY=${{ secrets.POH_VERIFIER_TESTNET_PRIVATE_KEY }}
context: ./packages/poh-verifier
file: ./packages/poh-verifier/Dockerfile
push: true
tags: consensys/linea-resolver:${{ env.DOCKER_TAG_TESTNET }}

- name: Docker Image Build and Publish Mainnet
uses: docker/build-push-action@v4
with:
build-args: |
ENV_FILE=.env.production
SIGNER_PRIVATE_KEY=${{ secrets.POH_VERIFIER_PRIVATE_KEY }}
ENV_FILE=.env.mainnet
SIGNER_PRIVATE_KEY=${{ secrets.POH_VERIFIER_MAINNET_PRIVATE_KEY }}
context: ./packages/poh-verifier
file: ./packages/poh-verifier/Dockerfile
push: true
tags: consensys/linea-resolver:${{ env.DOCKER_TAG }}
tags: consensys/linea-resolver:${{ env.DOCKER_TAG_MAINNET }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Env
NODE_ENV=development
NODE_ENV=production
PORT=3000

# Signer
Expand All @@ -8,4 +8,4 @@ VERIFIER_CONTRACT_ADDRESS=0xa904d832aBEBb150acde3Aa520cAC39B0970AF1b
# Poh API
POH_API_URL=https://linea-xp-poh-api.linea.build

CHAIN_ID=11155111
CHAIN_ID=59144
11 changes: 11 additions & 0 deletions packages/poh-verifier/.env.testnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Env
NODE_ENV=testnet
PORT=3000

# Signer
VERIFIER_CONTRACT_ADDRESS=0xa904d832aBEBb150acde3Aa520cAC39B0970AF1b

# Poh API
POH_API_URL=https://linea-xp-poh-api.linea.build

CHAIN_ID=59141

0 comments on commit 00c8b2c

Please sign in to comment.