Skip to content

Commit

Permalink
Add GitHub Actions workflow for multi-arch Docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
sharonsyh committed Jul 25, 2024
1 parent d61b5fb commit b04422c
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Build and Push Multi-Arch Docker Image

on:
push:
branches:
- multi-arch-docker-build
pull_request:
branches:
- multi-arch-docker-build

env:
REGISTRY_IMAGE: mlenergy/zeus:master

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: ${{ matrix.platform }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit b04422c

Please sign in to comment.