sqzass.git

sqzass

~ static site generator in Rust
git clone https://github.com/debuman/sqzass.git
commit 79c742bd888c498e0047d2951d57f370e4492163
parent 5cec51af7e9eaf20547d8d12dda92ecde366d370
Author: sqzer <110329244+devastator-x@users.noreply.github.com>
Date: Sat, 25 Jul 2026 16:50:51 +0900

Add CI and GitHub Pages deployment workflows

CI runs fmt, clippy -D warnings and tests, then builds the docs site with the
binary it just compiled -- that build is the integration test the unit tests
cannot be. It also builds twice and diffs, so a regression in output
determinism fails the pipeline rather than surfacing as a mystery later.

Pages builds docs/ and deploys via upload-pages-artifact. The custom domain
lives in docs/static/CNAME rather than inline in the workflow, so it travels
with the site; the explicit copy step goes away once the asset pipeline lands
and static/ is handled by sqzass itself.

Diffstat:
A.github/workflows/ci.yml | 43+++++++++++++++++++++++++++++++++++++++++++
A.github/workflows/pages.yml | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
Adocs/static/CNAME | 1+
3 files changed, 97 insertion(+), 0 deletion(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
@@ -0,0 +1,43 @@
+name: CI
+
+on:
+  push:
+    branches: [main]
+  pull_request:
+
+env:
+  CARGO_TERM_COLOR: always
+
+jobs:
+  check:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v7
+
+      - uses: dtolnay/rust-toolchain@stable
+        with:
+          components: rustfmt, clippy
+
+      - uses: Swatinem/rust-cache@v2
+
+      - name: Format
+        run: cargo fmt --check
+
+      - name: Clippy
+        run: cargo clippy --all-targets -- -D warnings
+
+      - name: Test
+        run: cargo test
+
+      # sqzass가 자기 문서 사이트를 빌드할 수 있어야 한다. 이게 회귀 테스트다 —
+      # 단위 테스트가 놓치는 통합 문제를 실제 사이트가 잡는다.
+      - name: Build the docs site
+        run: cargo run --quiet -- build -i docs
+
+      # 같은 입력이면 같은 바이트가 나와야 한다. 두 페이지가 같은 출력 URL을
+      # 주장할 때 파일 순회 순서에 따라 결과가 달라지는 종류의 버그를 잡는다.
+      - name: Build is reproducible
+        run: |
+          cargo run --quiet -- build -i docs -o "$RUNNER_TEMP/a"
+          cargo run --quiet -- build -i docs -o "$RUNNER_TEMP/b"
+          diff -r "$RUNNER_TEMP/a" "$RUNNER_TEMP/b"
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
@@ -0,0 +1,53 @@
+name: Deploy docs
+
+on:
+  push:
+    branches: [main]
+  workflow_dispatch:
+
+permissions:
+  contents: read
+  pages: write
+  id-token: write
+
+# 배포는 직렬로. 진행 중인 배포를 취소하면 사이트가 반쯤 갱신된 상태로 남을 수 있다.
+concurrency:
+  group: pages
+  cancel-in-progress: false
+
+env:
+  CARGO_TERM_COLOR: always
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v7
+
+      - uses: dtolnay/rust-toolchain@stable
+
+      - uses: Swatinem/rust-cache@v2
+
+      - uses: actions/configure-pages@v6
+
+      - name: Build the site
+        run: cargo run --quiet -- build -i docs
+
+      # 커스텀 도메인. sqzass의 에셋 파이프라인(M1)이 들어오면 docs/static/ 아래
+      # 파일이 자동으로 복사되므로 이 단계는 그때 삭제한다.
+      - name: Copy static files
+        run: cp -r docs/static/. docs/public/
+
+      - uses: actions/upload-pages-artifact@v5
+        with:
+          path: docs/public
+
+  deploy:
+    needs: build
+    runs-on: ubuntu-latest
+    environment:
+      name: github-pages
+      url: ${{ steps.deployment.outputs.page_url }}
+    steps:
+      - id: deployment
+        uses: actions/deploy-pages@v5
diff --git a/docs/static/CNAME b/docs/static/CNAME
@@ -0,0 +1 @@
+sqzass.sqzer.com