Skip to content

Commit 3242c18

Browse files
committed
Add Dockerfile for multi-arch builds
1 parent 03bb21a commit 3242c18

4 files changed

Lines changed: 264 additions & 247 deletions

File tree

.github/workflows/docker.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*.*.*"
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- name: Check Out Repo
19+
uses: actions/checkout@v4
20+
21+
- name: Docker metadata
22+
id: metadata
23+
uses: docker/metadata-action@v5
24+
with:
25+
images: |
26+
ghcr.io/${{ github.repository }}
27+
tags: |
28+
type=raw,value=latest,enable={{is_default_branch}}
29+
type=ref,event=branch
30+
type=ref,event=tag
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v3
34+
35+
- name: Login to GitHub Container Registry
36+
uses: docker/login-action@v3
37+
with:
38+
registry: ghcr.io
39+
username: ${{ github.repository_owner }}
40+
password: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Build CLI
43+
id: docker_build
44+
uses: docker/build-push-action@v5
45+
with:
46+
file: Dockerfile.multi
47+
push: ${{ github.event_name != 'pull_request' }}
48+
tags: ${{ steps.metadata.outputs.tags }}
49+
cache-from: type=gha
50+
cache-to: type=gha,mode=max
51+
platforms: linux/amd64,linux/arm64

0 commit comments

Comments
 (0)