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
38 changes: 36 additions & 2 deletions .github/workflows/spz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
- '**'
workflow_dispatch:

env:
SHA: ${{ github.event.pull_request.head.sha || github.sha }}

jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -154,7 +157,8 @@ jobs:

- name: Install Python build tools
run: |
python -m pip install --upgrade pip setuptools wheel scikit-build ninja cmake
python -m pip install --no-cache-dir --upgrade pip setuptools wheel scikit-build ninja cmake
python -m pip cache purge || true

- name: Prepare compiler environment for Windows
if: runner.os == 'Windows'
Expand All @@ -163,7 +167,7 @@ jobs:
arch: x64

- name: Build wheels
uses: pypa/cibuildwheel@v3.0.1
uses: pypa/cibuildwheel@v3.1.3
env:
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
CIBW_ARCHS_LINUX: "x86_64"
Expand All @@ -177,6 +181,8 @@ jobs:
elif [ -f /etc/alpine-release ]; then
apk update && apk add --no-cache clang lld ninja
fi
pip cache purge || rm -rf ~/.cache/pip || true
CIBW_ENVIRONMENT: "PIP_NO_CACHE_DIR=1 PIP_DISABLE_PIP_VERSION_CHECK=1"
CIBW_ENVIRONMENT_LINUX: "CC=clang CXX=clang++ LDFLAGS=-fuse-ld=lld"
with:
output-dir: dist/wheels
Expand Down Expand Up @@ -233,3 +239,31 @@ jobs:
${{ github.workspace }}/build_wasm/index.html
${{ github.workspace }}/build_wasm/spz_wasm.js
${{ github.workspace }}/build_wasm/spz_wasm.wasm

push-website:
needs:
- build
- build-static-linux
- build-wheels
- build-docker
- build_wasm
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: src/ts
file: src/ts/Dockerfile
platforms: linux/amd64
push: true
tags: 404gen/spz-website:${{ env.SHA }}
no-cache: true
25 changes: 25 additions & 0 deletions src/ts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM oven/bun:1.2.19-alpine AS builder

RUN apk update && apk upgrade --no-cache && apk add --no-cache openssl ca-certificates curl unzip && update-ca-certificates

WORKDIR /app
COPY package.json ./
RUN bun install

# Copy the rest of the app
COPY . .
# Fetch latest spz-wasm.zip into public/
RUN curl -sL https://github.com/404-Repo/spz/releases/latest/download/spz-wasm.zip -o spz-wasm.zip \
&& unzip spz-wasm.zip -d public/ \
&& rm spz-wasm.zip

RUN bun run bun:build

FROM oven/bun:1.2.19-alpine AS runner

WORKDIR /app
COPY --from=builder /app .

EXPOSE 3000

CMD ["bun", "run", "bun:start"]
7 changes: 7 additions & 0 deletions src/ts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- '3000:3000'
18 changes: 9 additions & 9 deletions src/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
"bun:lint": "bun --bun next lint"
},
"dependencies": {
"react": "^19.1.0",
"react-dom": "^19.1.0",
"next": "^15.3.3"
"react": "^19.1.1",
"react-dom": "^19.1.1",
"next": "^15.4.5"
},
"devDependencies": {
"typescript": "^5.8.3",
"@types/node": "^24.0.0",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9.28.0",
"eslint-config-next": "^15.3.3",
"typescript": "^5.9.2",
"@types/node": "^24.2.0",
"@types/react": "^19.1.9",
"@types/react-dom": "^19.1.7",
"eslint": "^9.32.0",
"eslint-config-next": "^15.4.5",
"@eslint/eslintrc": "^3.3.1"
}
}