Publish to GitHub Pages
Publish the viewer to GitHub Pages from GitHub Actions, checked and rebuilt on every push to the default branch.
Before you start
Section titled “Before you start”- The Workspace is in a GitHub repo, and
archidocs checkpasses. See the Quick start. - You can change the repo’s settings.
1. Add the workflow
Section titled “1. Add the workflow”Add this file to the Workspace repo. The Archidocs GitHub Action checks the Workspace, builds the site and deploys it:
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: archidocsKeep fetch-depth: 0: the site shows past Revisions, Workspace states at past commits, and builds them from git. Every input, such as working-directory, keep and version, is in the GitHub Action reference.
2. Turn on Pages
Section titled “2. Turn on Pages”In the repo, set Settings › Pages › Source to GitHub Actions.
3. Push
Section titled “3. Push”Commit the workflow and push it to the default branch. The Action runs on every push to the default branch and on every tag.
Check it worked
Section titled “Check it worked”Open the workflow run in the repo’s Actions tab. When it succeeds, the publish job shows the site’s URL, the Action’s page-url output. Open it: the viewer starts on the C1 Landscape.
If it didn’t
Section titled “If it didn’t”If archidocs check fails, the Action stops and deploys nothing, so the last good site stays up. The run’s log shows the file, the line and the rule, with a link to the rule’s page. Fix it and push again.
If the deploy step fails with a permissions error, check that the workflow grants pages: write and id-token: write, and that Pages’ source is GitHub Actions.
If the viewer shows only the latest Revision, the checkout is shallow. Set fetch-depth: 0 on actions/checkout.
Related
Section titled “Related”- Revisions and history, including the history cache the Action keeps
- GitHub Action reference
- Publish Saved View images and Preview pull requests
Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.