forked from axiom-crypto/openvm-eth
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (83 loc) · 2.83 KB
/
Copy pathbuild-server.yml
File metadata and controls
93 lines (83 loc) · 2.83 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: "Build Server Image"
on:
workflow_dispatch:
inputs:
instance_family:
type: string
required: false
description: Runner instance family (GPU recommended)
default: g6e.2xlarge
push:
type: boolean
required: false
description: Push image to registry (GHCR)
default: false
image_repository:
type: string
required: false
description: Image repository (default ghcr.io/<owner>/openvm-reth-benchmark-server)
tag:
type: string
required: false
description: Image tag (default commit SHA)
permissions:
contents: read
packages: write
env:
DOCKER_BUILDKIT: "1"
jobs:
build:
name: Build server Docker image
runs-on:
- runs-on
- run-id=${{ github.run_id }}
- family=${{ inputs.instance_family }}
- disk=large
- tag=build-server-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
- image=${{ startsWith(inputs.instance_family, 'g') && 'ubuntu24-gpu-x64' || contains(inputs.instance_family, 'g.') && 'ubuntu24-full-arm64' || 'ubuntu24-full-x64' }}
steps:
- uses: runs-on/action@v2
- name: Checkout
uses: actions/checkout@v5
- name: Determine image metadata
id: meta
shell: bash
run: |
if [[ -n "${{ inputs.image_repository }}" ]]; then
IMAGE_REPO="${{ inputs.image_repository }}"
else
IMAGE_REPO="ghcr.io/${{ github.repository_owner }}/openvm-reth-benchmark-server"
fi
if [[ -n "${{ inputs.tag }}" ]]; then
IMAGE_TAG="${{ inputs.tag }}"
else
IMAGE_TAG="${{ github.sha }}"
fi
echo "image=${IMAGE_REPO}" >> "$GITHUB_OUTPUT"
echo "tag=${IMAGE_TAG}" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
if: ${{ inputs.push == true }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: ${{ inputs.push == true }}
tags: ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
- name: Build summary
shell: bash
run: |
echo "### Server Docker image" >> $GITHUB_STEP_SUMMARY
echo "- Image: ${{ steps.meta.outputs.image }}" >> $GITHUB_STEP_SUMMARY
echo "- Tag: ${{ steps.meta.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
echo "- Pushed: ${{ inputs.push }}" >> $GITHUB_STEP_SUMMARY