Skip to content

Commit a69525c

Browse files
authored
feat(ci): add GitHub Actions workflow to build and push slashoor Dock… (#328)
…er image This introduces a new workflow `build-push-slashoor.yml` to automate the building, tagging, and pushing of the Docker image for `slashoor`. This is done to include `slashoor` in the regular CI build process, using configurable source repository, ref, and target tag, and supporting multi-platform builds as defined in `platforms.yaml`.
1 parent 7c7fd95 commit a69525c

4 files changed

Lines changed: 119 additions & 0 deletions

File tree

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Build slashoor docker image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
repository:
7+
description: The source slashoor repository to build from
8+
default: ethpandaops/slashoor
9+
type: string
10+
required: true
11+
ref:
12+
description: The branch, tag or SHA to checkout and build from
13+
default: master
14+
type: string
15+
required: true
16+
docker_tag:
17+
description: Override target docker tag (defaults to the above source ref if left blank)
18+
type: string
19+
required: false
20+
21+
jobs:
22+
prepare:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
platforms: ${{ steps.setup.outputs.platforms }}
26+
target_tag: ${{ steps.tag.outputs.docker_tag }}
27+
steps:
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
- name: Prepare Matrix
30+
id: setup
31+
uses: ./.github/actions/prepare
32+
with:
33+
client: 'slashoor'
34+
- name: Generate target tag
35+
id: tag
36+
uses: ./.github/actions/docker-tag
37+
with:
38+
input: ${{ inputs.docker_tag || inputs.ref }}
39+
repository: ${{ inputs.repository }}
40+
upstream_repository: ethpandaops/slashoor
41+
docker_tag: ${{ inputs.docker_tag }}
42+
deploy:
43+
needs:
44+
- prepare
45+
runs-on: ${{ matrix.runner }}
46+
continue-on-error: true
47+
strategy:
48+
matrix:
49+
include: ${{fromJson(needs.prepare.outputs.platforms)}}
50+
outputs:
51+
git_commit_hash: ${{ steps.set_output.outputs.git_commit_hash }}
52+
steps:
53+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
54+
- uses: ./.github/actions/install-deps
55+
with:
56+
repository: ${{ inputs.repository }}
57+
- uses: ./.github/actions/deploy
58+
id: deploy
59+
with:
60+
source_repository: ${{ inputs.repository }}
61+
source_ref: ${{ inputs.ref }}
62+
target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }}
63+
target_repository: ethpandaops/slashoor
64+
platform: ${{ matrix.platform }}
65+
66+
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
67+
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
68+
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
69+
GOPROXY: "${{ vars.GOPROXY }}"
70+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
71+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
72+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
73+
74+
- name: Set job output
75+
id: set_output
76+
run: echo "git_commit_hash=${{ steps.deploy.outputs.git_commit_hash }}" >> $GITHUB_OUTPUT
77+
shell: bash
78+
manifest:
79+
needs:
80+
- prepare
81+
- deploy
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
85+
- uses: ./.github/actions/manifest
86+
with:
87+
source_repository: ${{ inputs.repository }}
88+
source_ref: ${{ inputs.ref }}
89+
target_tag: ${{ needs.prepare.outputs.target_tag }}
90+
target_repository: ethpandaops/slashoor
91+
platforms: ${{ needs.prepare.outputs.platforms }}
92+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
93+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
94+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
95+
git_commit_hash: ${{ needs.deploy.outputs.git_commit_hash }}
96+
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
97+
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
98+
notify:
99+
name: Discord Notification
100+
runs-on: ubuntu-latest
101+
needs:
102+
- prepare
103+
- deploy
104+
- manifest
105+
if: failure()
106+
steps:
107+
- name: Notify
108+
uses: nobrayner/discord-webhook@1766a33bf571acdcc0678f00da4fb83aad01ebc7 # v1
109+
with:
110+
github-token: ${{ secrets.github_token }}
111+
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Run the *Build **tooling*** workflow;
3737
- [Build mev-rs](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-mev-rs.yml) [[source](https://github.com/ralexstokes/mev-rs)]
3838
- [Build reth-rbuilder](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-reth-rbuilder.yml) [[source](https://github.com/flashbots/rbuilder)]
3939
- [Build Syncoor](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-syncoor.yml) [[source](https://github.com/ethpandaops/syncoor)]
40+
- [Build Slashoor](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-slashoor.yml) [[source](https://github.com/ethpandaops/slashoor)]
4041
- [Build ere-server-zisk](https://github.com/ethpandaops/eth-client-docker-image-builder/actions/workflows/build-push-ere-server-zisk.yml) [[source](https://github.com/eth-act/ere)]
4142

4243
## Adding a new image to build on schedule

branches.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,7 @@ ere-server-zisk:
218218
fuzztools:
219219
branches:
220220
- main
221+
222+
slashoor:
223+
branches:
224+
- master

platforms.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,6 @@ ere-server-zisk:
119119
fuzztools:
120120
- linux/amd64
121121
- linux/arm64
122+
slashoor:
123+
- linux/amd64
124+
- linux/arm64

0 commit comments

Comments
 (0)