Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Arch build #19

Merged
merged 7 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,32 @@ env:

jobs:
build:
strategy:
matrix:
include:
- arch: "linux/arm64"
dotnet_rid: "linux-arm64"
runner: "buildjet-2vcpu-ubuntu-2204-arm"
- arch: "linux/amd64"
dotnet_rid: "linux-amd64"
runner: "ubuntu-latest"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}-${{ matrix.arch }}
cancel-in-progress: true
runs-on: buildjet-2vcpu-ubuntu-2204-arm
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Building for ${{ matrix.arch }} on ${{ matrix.runner }}
run: echo "Building for $ARCH on $RUNNER"
env:
ARCH: ${{ matrix.arch }}
RUNNER: ${{ matrix.runner }}
- name: Checkout repository
uses: actions/checkout@v4

Expand Down Expand Up @@ -75,20 +89,16 @@ jobs:
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
env:
BRANCH_NAME: ${{ env.BRANCH_NAME }}
uses: docker/build-push-action@v6.10.0
with:
context: .
file: ./SimpleCDN/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm64
platforms: ${{ matrix.arch }}
build-args: |
DOTNET_BUILD_PLATFORM=linux-arm64
# set version number to the version in the tag name if this is a release
# VERSION_NUMBER=$BRANCH_NAME
DOTNET_BUILD_PLATFORM=${{ matrix.dotnet_rid }}

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
Expand Down
Loading