Build and deploy the website with GitHub Actions - #122
Merged
Conversation
The website was previously built by hand and the result checked in, along with the website's node_modules directory and the automatically generated command-line documentation. Add a `website` workflow that generates the command documentation, builds the website, and deploys it to GitHub Pages on every push to master, and stop tracking the generated files. Two fixes to internal/autogen.go were needed to make the generated documentation reproducible from a fresh checkout: - Create docs/cmd if it does not exist, and report errors from doc.GenMarkdownTree instead of silently walking a missing directory. - Build the variable-resolution grid used to list the model output options in a temporary directory rather than reading the checked-in cmd/inmap/testdata/inmapVarGrid.gob, which was written by an older, incompatible version of InMAP. Because the command documentation is no longer in the repository, the README links to it on the website instead of by relative path. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The website was previously built by hand and the result checked in, along with the website's
node_modulesdirectory and the automatically generated command-line documentation. This adds awebsiteworkflow that generates the command documentation, builds the website, and deploys it to GitHub Pages on every push tomaster, and stops tracking the generated files.What changed
.github/workflows/website.ymlgo generate .→npm ci→npx docusaurus-build→upload-pages-artifact→deploy-pages. Deploys on pushes tomaster; pull requests and other branches build only, as a check..gitignorewebsite/build/,website/node_modules/,docs/cmd/anddocs/output_options.md— 17,729 files.website/static/CNAMEinmap.run, so the deployed artifact carries the custom domain.internal/autogen.gowebsite/Makefile,website/README.mdmake host,make build,make clean) replacing the Docker and yarn flow.README.md,RELEASE.mdFixes to
internal/autogen.goGenerating the documentation from a fresh checkout did not work before:
docs/cmdis now created if it does not exist, and the error fromdoc.GenMarkdownTreeis checked. Previously a missing directory made the call fail silently and then panic infilepath.Walk.writeOutputOptionsbuilds the variable-resolution grid in a temporary directory instead of reading the checked-incmd/inmap/testdata/inmapVarGrid.gob. That file was written by InMAP 1.6.1 and the current code requires 1.10.0, so generation failed outright withInMAP variable grid data version 1.6.1 is not compatible with the required version 1.10.0.As a result the regenerated command documentation differs slightly from the copies that were checked in, which were missing
inmap sr start --versionand carried a stale--EmissionMaskGeoJSONdescription.Verification
A fresh clone of this branch runs
go generate .,npm ciandnpx docusaurus-buildsuccessfully and produces a site with the same 113 files as the build that was previously checked in, plus the newCNAME.Before this can serve inmap.run
Two steps are needed outside this repository, in this order:
/eieioand the cloud API off the apex domain.inmap.run:443is the default gRPC endpoint (inmaputil/cmd.go:1066) andhttps://inmap.run/eieiois linked from the site header. GitHub Pages serves static files only, so repointinginmap.runat it breaks both. They need another hostname, along with a matching header link insiteConfig.jsand a new client default.inmap.run, and change DNS from35.232.224.150to GitHub's Pages A records.Until step 2, the workflow still runs and deploys to
spatialmodel.github.io/inmap, where assets will 404 becausebaseUrlis/. That resolves itself once the custom domain is live.Optional cleanup: the
gh-pagesandgh-pages-bakbranches hold an unrelated 2016 APEEP site. Actions-based Pages ignores them.🤖 Generated with Claude Code