Deploy site #16
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
| name: Deploy site | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| # Pick up docs changes in component repos (no cross-repo push trigger yet). | |
| schedule: | |
| - cron: "0 6 * * *" | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build site | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout site (this repo) | |
| uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install site dependencies | |
| run: pip install -r requirements.txt | |
| # --- Import component docs --------------------------------------------- | |
| # Each component repo contributes only its docs/ markdown; this site owns | |
| # all config. To add a repo: check it out and copy its docs into | |
| # docs/<section>/ (its .pages files travel with it and drive the nav). | |
| - name: Checkout fiberpath/fiberpath | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: fiberpath/fiberpath | |
| path: components/fiberpath | |
| - name: Import fiberpath docs | |
| run: | | |
| dest="docs/fiberpath" | |
| rm -rf "$dest" && mkdir -p "$dest" | |
| cp -R components/fiberpath/docs/. "$dest/" | |
| # GUI docs live beside the GUI code; fold them in under gui/ | |
| mkdir -p "$dest/gui" | |
| cp -R components/fiberpath/fiberpath_gui/docs/. "$dest/gui/" | |
| # ----------------------------------------------------------------------- | |
| - name: Build site | |
| run: mkdocs build --strict | |
| # Publish the canonical .wind JSON Schema at its $id path. Sourced live from | |
| # fiberpath/fiberpath's generated artifact (checked out above) — no vendored | |
| # copy to drift. Done post-build so mkdocs --strict never processes it; the | |
| # $id is major-only, so every additive 1.x schema serves from /schemas/wind/1/. | |
| - name: Publish .wind JSON Schema ($id) | |
| run: | | |
| mkdir -p site/schemas/wind/1 | |
| cp components/fiberpath/fiberpath_gui/schemas/wind-schema.json \ | |
| site/schemas/wind/1/wind.schema.json | |
| # Fail loudly if the published $id doesn't match its serving URL. | |
| grep -q '"https://fiberpath.org/schemas/wind/1/wind.schema.json"' \ | |
| site/schemas/wind/1/wind.schema.json | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: site | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |