Skip to content

Commit 42527bc

Browse files
committed
ci: add Docker build and push for PRs targeting devnet branches
1 parent 8fc0d84 commit 42527bc

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Build and publish leanSpec node image when a PR targets a devnet branch.
2+
# Image is tagged with the base branch name (e.g. ghcr.io/leanethereum/leanspec-node:devnet3).
3+
name: Docker (devnet)
4+
5+
on:
6+
pull_request:
7+
types: [opened, synchronize]
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.base_ref }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
docker-devnet:
19+
name: Build and push Docker image (devnet)
20+
runs-on: ubuntu-latest
21+
if: startsWith(github.base_ref, 'devnet')
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Set up QEMU
27+
uses: docker/setup-qemu-action@v3
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
32+
- name: Log in to GHCR
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Build and push
40+
uses: docker/build-push-action@v6
41+
with:
42+
context: .
43+
target: node
44+
platforms: linux/amd64,linux/arm64
45+
push: true
46+
tags: ghcr.io/leanethereum/leanspec-node:${{ github.base_ref }}
47+
cache-from: type=gha
48+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)