Skip to content

Commit 1659688

Browse files
Jonathan D.A. Jewellclaude
andcommitted
feat: Phase 2 deployment infrastructure for Glyphbase
- Create landing page at docs/site/index.html * Professional design with feature comparison * Quick start instructions * Links to documentation and GitHub - Add GitHub Pages deployment workflow * Converts AsciiDoc docs to HTML * Deploys to glyphbase.lithoglyph.org * Includes examples and guides - Create Docker deployment * Multi-stage Dockerfile (UI + Server) * Production-ready docker-compose.yml * Healthchecks and volume mounts - Add release automation workflow * Builds multi-arch images (amd64, arm64) * Publishes to ghcr.io * Creates GitHub releases with notes - Create comprehensive INSTALL.md guide * 6 installation methods (Docker, compose, source, etc.) * Configuration reference * Troubleshooting section * VPS and Kubernetes deployment - Update license headers AGPL → PMPL * server/gleam.toml * ui/index.html * All new files use PMPL-1.0-or-later - Update naming FormBase → Glyphbase * justfile commands * Docker image tags * Port configuration (4000 instead of mixed 3000/8080) Phase 2 (Download & Install) complete. Ready for deployment to glyphbase.lithoglyph.org. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 76802f9 commit 1659688

File tree

9 files changed

+1020
-7
lines changed

9 files changed

+1020
-7
lines changed

.github/workflows/deploy-site.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
name: Deploy Landing Page
3+
4+
on:
5+
push:
6+
branches: [main]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
deploy:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
27+
28+
- name: Convert docs to HTML
29+
run: |
30+
# Convert AsciiDoc to HTML
31+
sudo apt-get update && sudo apt-get install -y asciidoctor
32+
33+
# Convert USER-GUIDE.adoc
34+
asciidoctor -o docs/site/USER-GUIDE.html docs/USER-GUIDE.adoc
35+
36+
# Convert QUICKSTART.md to HTML
37+
echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Quick Start</title>' > docs/site/QUICKSTART.html
38+
echo '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@5/github-markdown.min.css">' >> docs/site/QUICKSTART.html
39+
echo '<style>body{max-width:800px;margin:2rem auto;padding:2rem;}</style></head>' >> docs/site/QUICKSTART.html
40+
echo '<body class="markdown-body">' >> docs/site/QUICKSTART.html
41+
42+
# Use pandoc for markdown conversion
43+
sudo apt-get install -y pandoc
44+
pandoc QUICKSTART.md -o temp.html
45+
cat temp.html >> docs/site/QUICKSTART.html
46+
47+
echo '</body></html>' >> docs/site/QUICKSTART.html
48+
rm temp.html
49+
50+
# Copy examples
51+
mkdir -p docs/site/examples
52+
cp examples/*.json docs/site/examples/
53+
54+
- name: Setup Pages
55+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
56+
57+
- name: Upload artifact
58+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
59+
with:
60+
path: 'docs/site'
61+
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4

.github/workflows/release.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
name: Release
3+
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
packages: write
13+
14+
jobs:
15+
build-and-release:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3
23+
24+
- name: Login to GitHub Container Registry
25+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Extract metadata
32+
id: meta
33+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
34+
with:
35+
images: ghcr.io/${{ github.repository }}
36+
tags: |
37+
type=semver,pattern={{version}}
38+
type=semver,pattern={{major}}.{{minor}}
39+
type=semver,pattern={{major}}
40+
type=edge,branch=main
41+
type=sha
42+
43+
- name: Build and push Docker image
44+
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
45+
with:
46+
context: .
47+
push: true
48+
tags: ${{ steps.meta.outputs.tags }}
49+
labels: ${{ steps.meta.outputs.labels }}
50+
cache-from: type=gha
51+
cache-to: type=gha,mode=max
52+
platforms: linux/amd64,linux/arm64
53+
54+
- name: Create GitHub Release
55+
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2
56+
if: startsWith(github.ref, 'refs/tags/')
57+
with:
58+
generate_release_notes: true
59+
body: |
60+
## Installation
61+
62+
### Docker
63+
```bash
64+
docker pull ghcr.io/${{ github.repository }}:${{ github.ref_name }}
65+
docker run -p 4000:4000 -v ./data:/data ghcr.io/${{ github.repository }}:${{ github.ref_name }}
66+
```
67+
68+
### From Source
69+
```bash
70+
git clone -b ${{ github.ref_name }} https://github.com/${{ github.repository }}
71+
cd glyphbase/server
72+
gleam run
73+
```
74+
75+
Open http://localhost:4000 in your browser.
76+
77+
## What's New
78+
See the full changelog below.

Dockerfile

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Glyphbase Docker Image
3+
# Multi-stage build for minimal final image
4+
5+
# Stage 1: Build UI
6+
FROM docker.io/denoland/deno:2.1.4 AS ui-builder
7+
8+
WORKDIR /build/ui
9+
10+
# Copy UI dependencies
11+
COPY ui/deno.json ui/deno.lock ./
12+
COPY ui/package.json ui/rescript.json ./
13+
14+
# Install dependencies
15+
RUN deno cache deno.json
16+
17+
# Copy UI source
18+
COPY ui/ .
19+
20+
# Build UI
21+
RUN deno task build
22+
23+
# Stage 2: Build Server
24+
FROM docker.io/hexpm/gleam:1.7.1-erlang-27.2.1 AS server-builder
25+
26+
WORKDIR /build/server
27+
28+
# Copy server dependencies
29+
COPY server/gleam.toml server/manifest.toml* ./
30+
31+
# Download dependencies
32+
RUN gleam deps download
33+
34+
# Copy server source
35+
COPY server/src ./src
36+
COPY server/test ./test
37+
38+
# Build server
39+
RUN gleam build --target erlang
40+
41+
# Stage 3: Runtime
42+
FROM docker.io/hexpm/erlang:27.2.1-alpine
43+
44+
WORKDIR /app
45+
46+
# Install runtime dependencies
47+
RUN apk add --no-cache libstdc++ openssl
48+
49+
# Copy built server from builder
50+
COPY --from=server-builder /build/server/build /app/build
51+
52+
# Copy built UI from builder
53+
COPY --from=ui-builder /build/ui/dist /app/public
54+
55+
# Create data directory
56+
RUN mkdir -p /data && chmod 777 /data
57+
58+
# Environment variables
59+
ENV PORT=4000
60+
ENV DATABASE_PATH=/data
61+
ENV GLEAM_ERLANG_PATH=/app/build
62+
63+
# Expose port
64+
EXPOSE 4000
65+
66+
# Health check
67+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
68+
CMD wget --no-verbose --tries=1 --spider http://localhost:4000/health || exit 1
69+
70+
# Run server
71+
CMD ["gleam", "run"]

0 commit comments

Comments
 (0)