Skip to content

Commit deb943c

Browse files
committed
feat: scaffold certforge static site
0 parents  commit deb943c

19 files changed

Lines changed: 7632 additions & 0 deletions

.github/workflows/deploy.yml

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

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
node_modules
3+
dist
4+
.astro
5+
coverage
6+
.env
7+
.env.*
8+
npm-debug.log*
9+
pnpm-lock.yaml
10+
yarn.lock

.husky/_/husky.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env sh
2+
# shellcheck shell=sh
3+
4+
if [ -z "$husky_skip_init" ]; then
5+
husky_skip_init=1
6+
7+
export PATH="${PATH}:./node_modules/.bin"
8+
fi

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
echo "Running test suite before commit..."
5+
npm test

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# CertForge Static Site
2+
3+
A lightweight Astro site that showcases every CertForge certification domain, links to the open-source prep repositories, and highlights the hands-on demos that live inside each repo. The site is optimized for GitHub Pages or Cloudflare Pages and enforces tests locally and in CI before deployments run.
4+
5+
## Tech Stack
6+
7+
- [Astro](https://astro.build) for the static site
8+
- TypeScript modules for study-track data
9+
- [Vitest](https://vitest.dev) for data integrity tests
10+
- [Husky](https://typicode.github.io/husky) git hooks to block commits when tests fail
11+
- GitHub Actions workflow for test + deploy to Pages
12+
13+
## Getting Started
14+
15+
```bash
16+
npm install
17+
npm run dev
18+
```
19+
20+
The dev server runs on `http://localhost:4321` by default.
21+
22+
## Tests
23+
24+
All commits must pass the Vitest suite (a Husky `pre-commit` hook enforces this).
25+
26+
```bash
27+
npm test # one-off
28+
npm run test:watch
29+
```
30+
31+
The tests verify that each track’s domain weights total 100%, every repo link resolves to the CertForge org, and that each track exposes labs/scripts for the website to promote.
32+
33+
## Deployment
34+
35+
The workflow in `.github/workflows/deploy.yml` handles:
36+
37+
1. `npm ci`
38+
2. `npm test`
39+
3. `npm run build`
40+
4. Upload + deploy to GitHub Pages
41+
42+
The static build artifacts live in `dist/`. Configure Pages to serve from the GitHub Actions workflow output. The same build directory can be uploaded to Cloudflare Pages if desired.
43+
44+
## Project Structure
45+
46+
```
47+
├── public/ # Static assets (logos, favicons)
48+
├── src/
49+
│ ├── components/ # Reusable UI blocks (track cards, domains)
50+
│ ├── data/ # Track/domain metadata used for rendering + tests
51+
│ ├── layouts/ # Site shell
52+
│ ├── pages/ # Astro pages
53+
│ └── styles/ # Global CSS
54+
├── tests/ # Vitest suites
55+
└── .husky/ # Git hooks (pre-commit triggers npm test)
56+
```
57+
58+
## Contributing
59+
60+
1. Create a branch: `git checkout -b feat/add-track`.
61+
2. Update the relevant data in `src/data/`.
62+
3. Run `npm test && npm run lint`.
63+
4. Commit (the pre-commit hook will re-run `npm test`).
64+
5. Open a PR describing the update and referencing the source repo.

astro.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from 'astro/config';
2+
3+
export default defineConfig({
4+
site: 'https://certforge.github.io/GITHUB_README',
5+
integrations: [],
6+
build: {
7+
format: 'directory',
8+
inlineStylesheets: 'auto'
9+
}
10+
});

0 commit comments

Comments
 (0)