Skip to content
name: "Build and Publish poh-signer-api"
on:
push:
branches:
- main
paths:
- "packages/poh-signer-api/**"
pull_request:
branches:
- main
paths:
- "packages/poh-signer-api/**"
release:
types:
- released
jobs:
poh-signer-api-build-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Docker Tag Tesnet
id: docker-tag-testnet
if: ${{ github.event_name != 'release' }}
run: echo "DOCKER_TAG_TESTNET=${GITHUB_SHA:0:7}-$(date +%s)-poh-signer-api-testnet" | tee $GITHUB_ENV
- 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-signer-api-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-signer-api-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_MAINNET=${GITHUB_SHA:0:7}-$(date +%s)-poh-signer-api-mainnet-${GITHUB_REF#refs/tags/}" | tee $GITHUB_ENV
- name: Login to Docker Repository
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_REPO_USER }}
password: ${{ secrets.DOCKER_REPO_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker Image Build and Publish on Sepolia Testnet
uses: docker/build-push-action@v4
with:
build-args: |
ENV_FILE=.env.sepolia
WEB3SIGNER_BASE_URL=${{ secrets.WEB3SIGNER_BASE_URL_TESTNET }}
WEB3SIGNER_PUBLIC_KEY=${{ secrets.WEB3SIGNER_PUBLIC_KEY_TESTNET }}
context: ./packages/poh-signer-api
file: ./packages/poh-signer-api/Dockerfile
push: true
tags: consensys/linea-resolver:${{ env.DOCKER_TAG_TESTNET }}
- name: Docker Image Build and Publish on Mainnet
uses: docker/build-push-action@v4
with:
build-args: |
ENV_FILE=.env.mainnet
WEB3SIGNER_BASE_URL=${{ secrets.WEB3SIGNER_BASE_URL_MAINNET }}
WEB3SIGNER_PUBLIC_KEY=${{ secrets.WEB3SIGNER_PUBLIC_KEY_MAINNET }}
context: ./packages/poh-signer-api
file: ./packages/poh-signer-api/Dockerfile
push: true
tags: consensys/linea-resolver:${{ env.DOCKER_TAG_MAINNET }}