Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 9 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
# Docker
- name: Docker production
run: docker build .
# Set up Docker Buildx for multi-arch support
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Build multi-arch image
- name: Build Docker image (multi-arch)
run: |
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 .
# Docker development
- name: Docker development
run: docker build -f Dockerfile.brain.dev .
run: docker buildx build -f Dockerfile.brain.dev --platform linux/amd64,linux/arm64 .
build:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# Set up Docker Buildx for multi-arch support
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Build and push multi-arch Docker image
- name: Build and push Staking brain docker monorepo
uses: docker/build-push-action@v3
with:
file: Dockerfile
push: true
platforms: linux/amd64, linux/arm64
tags: ghcr.io/${{ github.repository_owner }}/staking-brain:${{ github.event.inputs.tag }}

gh-release:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG DOCKER_IMAGE=node:20.17.0-alpine3.20

# Build
FROM ${DOCKER_IMAGE} AS build-stage
FROM --platform=$TARGETPLATFORM ${DOCKER_IMAGE} AS build-stage

WORKDIR /app
COPY package.json yarn.lock tsconfig.json .yarnrc.yml ./
Expand All @@ -19,7 +19,7 @@ RUN yarn install --immutable && \
yarn workspaces focus --all --production

# Production
FROM ${DOCKER_IMAGE}
FROM --platform=$TARGETPLATFORM ${DOCKER_IMAGE}
ENV NODE_ENV=production
WORKDIR /app
COPY ./packages/brain/tls ./tls
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.brain.dev
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG DOCKER_IMAGE=node:20.17.0-alpine3.20
FROM ${DOCKER_IMAGE} as build-stage
FROM --platform=$TARGETPLATFORM ${DOCKER_IMAGE} as build-stage

ENV NODE_ENV=development
WORKDIR /app
Expand Down