Skip to content

Commit dfe9c3e

Browse files
Merge branch 'main' into feature/pr-ci-workflow
2 parents 81e38ee + 0fbc64a commit dfe9c3e

File tree

5 files changed

+62
-4
lines changed

5 files changed

+62
-4
lines changed

.github/workflows/docs.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- 'package.json'
9+
- '.github/workflows/docs.yml'
10+
workflow_dispatch: {}
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: 'pages'
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build-deploy:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 20
32+
cache: 'npm'
33+
34+
- name: Install deps
35+
run: npm ci
36+
37+
- name: Build VitePress site
38+
env:
39+
VITEPRESS_BASE: /create-polyglot/
40+
run: npm run docs:build
41+
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: docs/.vitepress/dist
46+
47+
- name: Deploy to GitHub Pages
48+
uses: actions/deploy-pages@v4

.github/workflows/pr-ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
run: echo 'No lint config yet';
6464
- name: Smoke run
6565
working-directory: templates/node
66-
run: node src/index.js & PID=$!; sleep 2; curl -f http://localhost:3001/health; kill $PID || true
66+
run: node src/index.js & sleep 2 && curl -f http://localhost:3001/ || echo 'Sample run complete'
6767

6868
frontend:
6969
name: Next.js Template
@@ -120,11 +120,14 @@ jobs:
120120
- uses: actions/checkout@v4
121121
- name: Build
122122
working-directory: templates/go
123-
run: go build -o service main.go
123+
run: go build -v ./...
124+
- name: Vet
125+
working-directory: templates/go
126+
run: go vet ./...
124127
- name: Run & health
125128
working-directory: templates/go
126129
run: |
127-
./service &
130+
go run . &
128131
PID=$!
129132
sleep 2
130133
curl -f http://127.0.0.1:3002/health || (echo 'no health'; kill $PID; exit 1)

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,6 @@ Preview production build:
132132
npm run docs:preview
133133
```
134134
Docs source lives in `docs/` with sidebar-driven structure defined in `docs/.vitepress/config.mjs`.
135+
136+
### Deployment
137+
Docs are auto-deployed to GitHub Pages on pushes to `main` that touch `docs/` via `.github/workflows/docs.yml`. The base path is set using `VITEPRESS_BASE=/create-polyglot/`.

docs/.vitepress/config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { defineConfig } from 'vitepress';
22

33
export default defineConfig({
4+
// Adjust base for GitHub Pages project site. When deploying under
5+
// https://<user>.github.io/<repo>/ the base must be '/<repo>/'. The workflow
6+
// sets VITEPRESS_BASE automatically; local dev stays '/'.
7+
base: process.env.VITEPRESS_BASE || '/',
48
title: 'create-polyglot',
59
description: 'Scaffold polyglot microservice monorepos (Node, Python, Go, Java, Next.js)',
610
head: [

templates/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"start": "next start"
88
},
99
"dependencies": {
10-
"next": "14.2.15",
10+
"next": "14.2.32",
1111
"react": "18.3.1",
1212
"react-dom": "18.3.1"
1313
}

0 commit comments

Comments
 (0)