build arm image (#12)

This commit is contained in:
Doh
2025-01-03 21:02:27 -05:00
committed by GitHub
parent cb02b3831c
commit f031bd1361
5 changed files with 208 additions and 20 deletions

View File

@@ -4,7 +4,7 @@ on:
push: push:
branches: branches:
- main - main
# - github-actions - github-actions
jobs: jobs:
build-and-push: build-and-push:
@@ -40,22 +40,19 @@ jobs:
echo "EXISTS=false" >> $GITHUB_OUTPUT echo "EXISTS=false" >> $GITHUB_OUTPUT
fi fi
- name: Build Docker image - name: Set up Docker Buildx
run: docker build -t habittrove . uses: docker/setup-buildx-action@v3
- name: Push Docker images - name: Build and push Docker images
run: | uses: docker/build-push-action@v5
if [ "${{ steps.check-version.outputs.EXISTS }}" = "false" ]; then with:
docker tag habittrove dohsimpson/habittrove:v${{ steps.package-version.outputs.VERSION }} context: .
docker push dohsimpson/habittrove:v${{ steps.package-version.outputs.VERSION }} platforms: linux/amd64,linux/arm64
echo "Pushed tag: v${{ steps.package-version.outputs.VERSION }}" push: true
docker tag habittrove dohsimpson/habittrove:latest tags: |
docker push dohsimpson/habittrove:latest ${{ steps.check-version.outputs.EXISTS == 'false' && format('dohsimpson/habittrove:v{0}', steps.package-version.outputs.VERSION) || '' }}
echo "Pushed tag: latest" ${{ steps.check-version.outputs.EXISTS == 'false' && 'dohsimpson/habittrove:latest' || '' }}
fi dohsimpson/habittrove:dev
docker tag habittrove dohsimpson/habittrove:dev
docker push dohsimpson/habittrove:dev
echo "Pushed tag: dev"
deploy-demo: deploy-demo:
runs-on: ubuntu-latest runs-on: ubuntu-latest

25
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Unit Tests
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run unit tests
run: bun test

View File

@@ -1,9 +1,9 @@
# syntax=docker.io/docker/dockerfile:1 # syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine AS base FROM --platform=$BUILDPLATFORM node:18-alpine AS base
# Install dependencies only when needed # Install dependencies only when needed
FROM base AS deps FROM --platform=$BUILDPLATFORM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
WORKDIR /app WORKDIR /app
@@ -19,7 +19,7 @@ RUN \
fi fi
# Rebuild the source code only when needed # Rebuild the source code only when needed
FROM base AS builder FROM --platform=$BUILDPLATFORM base AS builder
WORKDIR /app WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .

166
package-lock.json generated
View File

@@ -19,6 +19,7 @@
"@types/bun": "^1.1.14", "@types/bun": "^1.1.14",
"@types/canvas-confetti": "^1.9.0", "@types/canvas-confetti": "^1.9.0",
"@uiw/react-heat-map": "^2.3.2", "@uiw/react-heat-map": "^2.3.2",
"bun": "^1.1.42",
"canvas-confetti": "^1.9.3", "canvas-confetti": "^1.9.3",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
@@ -892,6 +893,138 @@
"node": ">=12.4.0" "node": ">=12.4.0"
} }
}, },
"node_modules/@oven/bun-darwin-aarch64": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.1.42.tgz",
"integrity": "sha512-7kQkTVr99ndcU72xlIzA2QLavvT/DnEhvwTAq7LKi9/P3GtSAkhoA6UWZUa7pYw7OYHpUrEGXlV+PR3LllkGnw==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@oven/bun-darwin-x64": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.1.42.tgz",
"integrity": "sha512-2IPJnLvwLlD8YaXPbWwlpw2UvVrZE6/0uRbcSJNzZQAAZjEfN8AodqNRhggptn0A9vDmAw6q1U07QbiE4ilofw==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@oven/bun-darwin-x64-baseline": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.1.42.tgz",
"integrity": "sha512-26mtzVRLp/x89s27fXExG1vCCBOOFHLdqVYg/lHZMdDNHSh7Q7UiUhDRa+aVBlbsaGfw1LzoXdhh7Zy2hlF/6w==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@oven/bun-linux-aarch64": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.1.42.tgz",
"integrity": "sha512-qkoqI+oMcQ8GUej71qkAVj/VLlVpoBRyiYBQYq4yWsy+FU2jr2KWTeNZWrsY2crDiZj38AMNXJiKBr/EMy4MRg==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"linux"
]
},
"node_modules/@oven/bun-linux-aarch64-musl": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-musl/-/bun-linux-aarch64-musl-1.1.42.tgz",
"integrity": "sha512-PwbNLoirazjTYTSydn2AnId0jBJexZ99cwftOfdzIGCF5anEWvNEZ8PL4o79jHIhE0t01qGc8br9fQbiQ+iArw==",
"cpu": [
"aarch64"
],
"optional": true,
"os": [
"linux"
]
},
"node_modules/@oven/bun-linux-x64": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.1.42.tgz",
"integrity": "sha512-rV8Eqnvo/1z0nwYSiLrbl0F4G8uFQxlGA4P0zggW9W4PSiSHSRhG1aazG/8esBLzJI9CdFNncrtmiRTmWl1mIg==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux"
]
},
"node_modules/@oven/bun-linux-x64-baseline": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.1.42.tgz",
"integrity": "sha512-UzRNXgHEARFECgz30eot23OnPzd0J2L5SEsGhnGRhfJ706kjz0XmuGMnb9nmnoyHBcd2iSjk4nci1BlGmu4wCA==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux"
]
},
"node_modules/@oven/bun-linux-x64-musl": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl/-/bun-linux-x64-musl-1.1.42.tgz",
"integrity": "sha512-Djye8lPlhVNXdGbMF4bShVop8qvqPhPuPrhxEHfYJ8qhudSs2MiOWR5stvBWe8KLKahqDAWfWXuxByAXVhqb2Q==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux"
]
},
"node_modules/@oven/bun-linux-x64-musl-baseline": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl-baseline/-/bun-linux-x64-musl-baseline-1.1.42.tgz",
"integrity": "sha512-zgeiYJRGO3K4uK6Qdj1B5ZbU9NJxLwF9YGDFu9MtqEplyGNq7SpeuamvcP6SlZGgrVnc3AWrHFEYrVlv5Lqt+w==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux"
]
},
"node_modules/@oven/bun-windows-x64": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.1.42.tgz",
"integrity": "sha512-6eyHs6fVRCy0ujltYTwSX3bug+PqlgZRBv8x0PPekviaCJWYrFKVpHodA2972+Mih2pATurBSX2sLVq5uJUU7Q==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"win32"
]
},
"node_modules/@oven/bun-windows-x64-baseline": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.1.42.tgz",
"integrity": "sha512-xnlYa1jKknImCw7xmSD91H8e+w3BC6mIShOfHhFWfNhdyvEtundXhIu7VddwxKBMs5S/iiFJiutnZ2EyLq4CAQ==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"win32"
]
},
"node_modules/@pkgjs/parseargs": { "node_modules/@pkgjs/parseargs": {
"version": "0.11.0", "version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
@@ -2618,6 +2751,39 @@
"dev": true, "dev": true,
"peer": true "peer": true
}, },
"node_modules/bun": {
"version": "1.1.42",
"resolved": "https://registry.npmjs.org/bun/-/bun-1.1.42.tgz",
"integrity": "sha512-PckeNolMEBaBEzixTMvp0jJD9r/9lly8AfctILi1ve14zwwChFjsxI4TJLQO2yezzOjVeG0u7xf8WQFbS7GjAA==",
"cpu": [
"arm64",
"x64",
"aarch64"
],
"hasInstallScript": true,
"os": [
"darwin",
"linux",
"win32"
],
"bin": {
"bun": "bin/bun.exe",
"bunx": "bin/bun.exe"
},
"optionalDependencies": {
"@oven/bun-darwin-aarch64": "1.1.42",
"@oven/bun-darwin-x64": "1.1.42",
"@oven/bun-darwin-x64-baseline": "1.1.42",
"@oven/bun-linux-aarch64": "1.1.42",
"@oven/bun-linux-aarch64-musl": "1.1.42",
"@oven/bun-linux-x64": "1.1.42",
"@oven/bun-linux-x64-baseline": "1.1.42",
"@oven/bun-linux-x64-musl": "1.1.42",
"@oven/bun-linux-x64-musl-baseline": "1.1.42",
"@oven/bun-windows-x64": "1.1.42",
"@oven/bun-windows-x64-baseline": "1.1.42"
}
},
"node_modules/bun-types": { "node_modules/bun-types": {
"version": "1.1.37", "version": "1.1.37",
"resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.1.37.tgz", "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.1.37.tgz",

View File

@@ -19,7 +19,6 @@
"@radix-ui/react-slot": "^1.1.1", "@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-switch": "^1.1.2", "@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-toast": "^1.2.4", "@radix-ui/react-toast": "^1.2.4",
"@types/bun": "^1.1.14",
"@types/canvas-confetti": "^1.9.0", "@types/canvas-confetti": "^1.9.0",
"@uiw/react-heat-map": "^2.3.2", "@uiw/react-heat-map": "^2.3.2",
"canvas-confetti": "^1.9.3", "canvas-confetti": "^1.9.3",
@@ -47,6 +46,7 @@
"@types/node": "^20.17.10", "@types/node": "^20.17.10",
"@types/react": "^19", "@types/react": "^19",
"@types/react-dom": "^19", "@types/react-dom": "^19",
"@types/bun": "^1.1.14",
"eslint": "^9", "eslint": "^9",
"eslint-config-next": "15.1.3", "eslint-config-next": "15.1.3",
"eslint-plugin-unused-imports": "^4.1.4", "eslint-plugin-unused-imports": "^4.1.4",