GitHub Pages
archidocs build --out <dir> writes a complete static site: the viewer, the latest Bundle (workspace.bundle.json), the past Bundles (bundles/<sha>.json) and the Revision index (bundles/index.json). Every URL in it is relative and the viewer uses hash routing, so any static host can serve it under any base path, with no rewrites.
The Archidocs GitHub Action does the whole job: it sets up Node, restores the history cache, runs archidocs check, then archidocs build, and deploys the site with upload-pages-artifact and deploy-pages.
Add the workflow
Section titled “Add the workflow”Add .github/workflows/architecture.yml to the Workspace repo:
name: Architectureon: push: branches: [main] tags: ["*"]
permissions: contents: read pages: write id-token: write
concurrency: group: pages cancel-in-progress: false
jobs: publish: runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.archidocs.outputs.page-url }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: chalharb/archidocs@v1 id: archidocsThen set the repository’s Settings › Pages › Source to GitHub Actions.
- It runs on every push to the default branch and on every tag. Tagged Revisions are always kept in the site’s history.
fetch-depth: 0checks out the full history, which the site needs to show past Revisions.- If
archidocs checkfails, nothing is deployed, so the last good site stays up. - The Action only ever deploys on a push to the default branch or a tag.
Options
Section titled “Options”Pass inputs under with:. The common ones:
working-directory: where to run Archidocs, when the Workspace isn’t at the repo root.keep: how many past Revisions the site keeps Bundles for (200 by default), orall.images: true: also publish each Saved View as an SVG. See Saved View images.preview: true: build a PR preview instead. See PR previews.version: the archidocs npm version to run, to pin it.
Every input and output is in the GitHub Action reference. Its outputs are site, the built site’s folder, and page-url.
The history cache
Section titled “The history cache”Past Bundles are built from git, never fetched from the live site. Archidocs keeps the ones it has built in .archidocs/cache/ and the Action saves that folder in the Actions cache, keyed by the Bundle schemaVersion. A first deploy, a lost cache or a new schemaVersion only costs build time: any Revision missing from the cache is rebuilt from git.
Related
Section titled “Related”- Revisions and history
- Other hosts, to publish somewhere else from GitHub Actions