-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (56 loc) · 2.04 KB
/
build-via-verifier.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
name: Build Via verifier
on:
workflow_dispatch:
inputs:
ref:
description: "Git reference (branch, commit, or tag) to build from"
type: string
required: false
image_tag_suffix:
description: "Optional suffix to override tag name generation"
type: string
required: false
jobs:
build-and-push:
name: Build and Push Docker Images
runs-on: [self-hosted, cpu]
steps:
- name: Set reference and fetch repo
run: |
if [[ -n "${{ inputs.ref }}" ]]; then
echo "REF=${{ inputs.ref }}" >> $GITHUB_ENV
else
REF="$(git rev-parse --abbrev-ref HEAD)" # Get the current branch if not provided
fi
- uses: actions/[email protected]
with:
ref: ${{ env.REF }}
submodules: 'recursive'
- name: Determine Docker tag
run: |
if [[ -n "${{ inputs.image_tag_suffix }}" ]]; then
TAG="${{ inputs.image_tag_suffix }}"
else
TAG=$(git rev-parse --short HEAD)
fi
echo "DOCKER_TAG=$TAG" >> $GITHUB_ENV
- name: Setup env
run: |
echo VIA_HOME=$(pwd) >> $GITHUB_ENV
echo CI=1 >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
echo CI=1 >> .env
echo IN_DOCKER=1 >> .env
- name: Build contracts
run: |
via
yarn l2-contracts build
yarn workspace system-contracts build
- name: Build image
run: |
docker buildx build -t via-verifier:${{ env.DOCKER_TAG }} -f docker/via-verifier/Dockerfile .
- name: Publish image to registry
run: |
docker tag via-verifier:${{ env.DOCKER_TAG }} europe-west3-docker.pkg.dev/viaorg-prod-net-landing-0/via/via-verifier:${{ env.DOCKER_TAG }}
docker push europe-west3-docker.pkg.dev/viaorg-prod-net-landing-0/via/via-verifier:${{ env.DOCKER_TAG }}
echo "Image: europe-west3-docker.pkg.dev/viaorg-prod-net-landing-0/via/via-verifier:${{ env.DOCKER_TAG }}"