Deploy site #9
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 | |
| - 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 |