Skip to content

Commit

Permalink
separate build for amd64 and arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
tvijverb committed Feb 16, 2024
1 parent 030acf9 commit 47f3dfa
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,29 @@ on:
- "v*.*.*"

jobs:
build-and-publish:
build-and-publish-amd64:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
run: |
docker build -t ghcr.io/${{ github.repository_owner }}/jlc-parts:latest-amd64 .
docker push ghcr.io/${{ github.repository_owner }}/jlc-parts:latest-amd64
build-and-publish-arm64:
runs-on: [self-hosted, ARM64]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -27,10 +38,6 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile # Path to your Dockerfile
platforms: linux/arm64,linux/amd64 # Add any other platforms you want to support
push: true
tags: ghcr.io/${{ github.repository_owner }}/jlc-parts:latest
run: |
docker build -t ghcr.io/${{ github.repository_owner }}/jlc-parts:latest-arm64 .
docker push ghcr.io/${{ github.repository_owner }}/jlc-parts:latest-arm64
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "atopile-jlc-parts"
version = "0.1.7"
version = "0.1.8"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down

0 comments on commit 47f3dfa

Please sign in to comment.