-
Notifications
You must be signed in to change notification settings - Fork 8
74 lines (64 loc) · 2.49 KB
/
poh-signer-api-build-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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 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-signer-api
file: ./packages/poh-signer-api/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.mainnet
SIGNER_PRIVATE_KEY=${{ secrets.POH_VERIFIER_MAINNET_PRIVATE_KEY }}
context: ./packages/poh-signer-api
file: ./packages/poh-signer-api/Dockerfile
push: true
tags: consensys/linea-resolver:${{ env.DOCKER_TAG_MAINNET }}