Skip to content

Commit

Permalink
add arm64 arch to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaariel91 committed Aug 21, 2024
1 parent 8f549b6 commit bb7d471
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ jobs:
build:
name: Docker images for ghcr.io
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
arch: [amd64, arm64]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_BASE: ${{ github.repository }}
DOCKER_PLATFORM: linux/${{ matrix.arch }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
Expand All @@ -31,21 +36,30 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up environment
run: |
echo "Setting up environment for ${{ matrix.arch }}"
if [ "${{ matrix.arch }}" == "amd64" ]; then
echo "TARGET_ARCH=x86_64" >> $GITHUB_ENV
elif [ "${{ matrix.arch }}" == "arm64" ]; then
echo "TARGET_ARCH=aarch64" >> $GITHUB_ENV
fi
# Prover and Verifier

- name: Prover&Verifier image tags & labels
id: meta-all
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/stone-prover
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/stone-prover-${TARGET_ARCH}

- name: Prover&Verifier image build & push
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64,linux/arm64
platforms: ${{ env.DOCKER_PLATFORM }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-all.outputs.tags }}
Expand All @@ -58,14 +72,14 @@ jobs:
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/cpu_air_prover
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/cpu_air_prover-${TARGET_ARCH}
- name: Prover image build & push
uses: docker/build-push-action@v3
with:
context: .
file: air_prover/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
platforms: ${{ env.DOCKER_PLATFORM }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
Expand All @@ -77,14 +91,14 @@ jobs:
id: meta-ver
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/cpu_air_verifier
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/cpu_air_verifier-${TARGET_ARCH}
- name: Verifier image build & push
uses: docker/build-push-action@v3
with:
context: .
file: air_verifier/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
platforms: ${{ env.DOCKER_PLATFORM }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-ver.outputs.tags }}
Expand Down

0 comments on commit bb7d471

Please sign in to comment.