Skip to content

Commit 0888471

Browse files
committed
ci: setup docker image build ci
1 parent c22e963 commit 0888471

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/docker.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
name: Build Docker Image
3+
4+
on:
5+
push:
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
strategy:
11+
matrix:
12+
include:
13+
- runner: ubuntu-24.04
14+
platform: linux/amd64
15+
arch: amd64
16+
- runner: ubuntu-24.04-arm
17+
platform: linux/arm64
18+
arch: arm64
19+
runs-on: ${{ matrix.runner }}
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
25+
fetch-depth: 0
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
31+
- name: Build Docker image for ${{ matrix.arch }}
32+
uses: docker/build-push-action@v5
33+
with:
34+
context: .
35+
file: ./Dockerfile
36+
platforms: ${{ matrix.platform }}
37+
push: false
38+
tags: your-image-name:${{ matrix.arch }}-${{ github.sha }},your-image-name:${{ matrix.arch }}-latest
39+
cache-from: type=gha
40+
cache-to: type=gha,mode=max
41+
42+

0 commit comments

Comments
 (0)