Skip to content

Commit

Permalink
feat: multi platform container build
Browse files Browse the repository at this point in the history
  • Loading branch information
paring-chan committed Jan 2, 2024
1 parent c83ad33 commit 846fdd2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/deploy-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
with:
submodules: true
- uses: docker/setup-buildx-action@v1
id: buildx
with:
platforms: linux/amd64,linux/arm64
- name: Login to container registry
uses: docker/login-action@v2
with:
Expand All @@ -31,6 +34,8 @@ jobs:
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
builder: ${{ steps.buildx.outputs.name }}
platforms: ${{ steps.buildx.outputs.platforms }}
build-args: |
API_ENDPOINT=${{ secrets.STAGING_API_ENDPOINT }}
OPENGRAPH_ENDPOINT=${{ secrets.STAGING_OPENGRAPH_ENDPOINT }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
with:
submodules: true
- uses: docker/setup-buildx-action@v1
id: buildx
with:
platforms: linux/amd64,linux/arm64

- name: Login to container registry
uses: docker/login-action@v2
with:
Expand All @@ -29,6 +33,8 @@ jobs:
context: .
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:staging
push: true
builder: ${{ steps.buildx.outputs.name }}
platforms: ${{ steps.buildx.outputs.platforms }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-alpine AS builder
FROM --platform=$BUILDPLATFORM node:18-alpine AS builder

RUN mkdir -p /app

Expand Down

0 comments on commit 846fdd2

Please sign in to comment.