Skip to content

Commit adc13da

Browse files
committed
feat(workflow): add build workflow for multi-arch Docker images
1 parent 7bfc814 commit adc13da

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/build.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
tags:
5+
- '*'
6+
7+
permissions:
8+
contents: read
9+
packages: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v6
17+
- name: Install Docker Emulation
18+
run: docker run --rm --privileged tonistiigi/binfmt:latest --install amd64,arm64
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
- name: Login to GitHub Container Registry
22+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
23+
- name: Build and Push Multi-Arch Docker Image
24+
run: |
25+
docker buildx build --platform linux/amd64,linux/arm64 -t $(echo 'ghcr.io/${{ github.repository }}:${{ github.ref_name }}' | tr '[:upper:]' '[:lower:]') --push .

0 commit comments

Comments
 (0)