feat(prototype): add upload manager and docker ci

- add prototype upload, list, view, and delete api routes
- add prototype manager ui with search, modal, and theme toggle
- add filesystem-backed zip extraction and serving logic
- switch project to pnpm with updated lockfile and tooling
- add multi-stage dockerfile with standalone next.js output
- add github actions to lint, build, and publish docker images
This commit is contained in:
siujamo committed 2026-08-31 13:43:59 +08:00
1 parent 0c592225e4
commit ed72045f5e
30 files changed
+5369 -6899

No files matched your search

+102
View File
@@ -0,0 +1,102 @@
name: Docker Build and Publish
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
packages: write
env:
IMAGE_NAME: prototype-manager
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
if: github.event_name != 'pull_request'
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Enable Corepack
if: github.event_name != 'pull_request'
run: corepack enable
- name: Install dependencies
if: github.event_name != 'pull_request'
run: pnpm install --frozen-lockfile
- name: Run lint
if: github.event_name != 'pull_request'
run: pnpm lint
- name: Set up QEMU
if: github.event_name != 'pull_request'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image (PR only, quick validation, no push)
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v6
with:
context: .
push: false
platforms: linux/amd64
cache-from: type=gha,scope=${{ github.ref_name }}
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}
- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract Docker metadata
if: github.event_name != 'pull_request'
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,format=short
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push image (multi-arch)
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ github.ref_name }}
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}