Skip to content

Commit

Permalink
ci: test github action on aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
Veirt committed Aug 4, 2024
1 parent 839821c commit 779feca
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker Build
on:
push:
branches:
- "master"
- "ci/optimize-build"
tags:
- "v*"
pull_request:
Expand All @@ -12,7 +12,7 @@ on:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME: vesta-test

jobs:
docker:
Expand All @@ -24,9 +24,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down Expand Up @@ -54,6 +51,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.aarch64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ COPY tailwind.config.js .
COPY src ./src
RUN bunx tailwindcss -i ./src/style.css -o ./out.css --minify

FROM --platform=$TARGETPLATFORM rust:1.80-alpine AS build
ARG TARGETPLATFORM
FROM rust:1.80-alpine AS build

RUN apk add musl-dev --no-cache

Expand Down
28 changes: 28 additions & 0 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM oven/bun:1-alpine AS css-builder
WORKDIR /temp
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile

COPY gridPlugin.js tailwind.config.js ./
COPY src ./src
RUN bunx tailwindcss -i ./src/style.css -o ./out.css --minify

FROM --platform=$BUILDPLATFORM rust:1.80-alpine AS build

RUN apk add musl-dev --no-cache && rustup target add aarch64-unknown-linux-musl

WORKDIR /usr/src
RUN USER=root cargo new --bin vesta
WORKDIR /usr/src/vesta
COPY Cargo.toml Cargo.lock ./
COPY src ./src
RUN cargo build --release --target=aarch64-unknown-linux-musl

FROM scratch

WORKDIR /app
COPY ./static static
COPY --from=css-builder /temp/out.css ./static/style.css
COPY --from=build /usr/src/vesta/target/aarch64-unknown-linux-musl/release/vesta /app/vesta

CMD ["/app/vesta"]

0 comments on commit 779feca

Please sign in to comment.