docs: rework package file formats and doc generation #2
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
| # SPDX-FileCopyrightText: 2026 The RISE Project | |
| # SPDX-License-Identifier: MIT | |
| name: Build and deploy documentation | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "docs/**" | |
| pull_request: | |
| types: [opened, synchronize, reopened, closed] | |
| workflow_dispatch: | |
| concurrency: | |
| group: docs-${{ github.ref }} | |
| jobs: | |
| preview: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| if: github.event.action != 'closed' | |
| with: | |
| python-version: '3' | |
| - name: Install package doc generator dependencies | |
| if: github.event.action != 'closed' | |
| run: pip install -r docs/requirements.txt | |
| - name: Generate package pages from YAML | |
| if: github.event.action != 'closed' | |
| run: python docs/packages/generate_packages_doc.py | |
| - name: Build with Jekyll | |
| if: github.event.action != 'closed' | |
| uses: actions/jekyll-build-pages@v1 | |
| with: | |
| source: ./docs | |
| destination: ./_site | |
| # Auto-detects deploy vs. removal from the pull_request event action, | |
| # so this same step both publishes updates and tears down the preview | |
| # when the PR is closed. | |
| - name: Deploy or remove PR preview | |
| uses: rossjrw/pr-preview-action@v1 | |
| with: | |
| source-dir: ./_site | |
| deploy: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3' | |
| - name: Install package doc generator dependencies | |
| run: pip install -r docs/requirements.txt | |
| - name: Generate package pages from YAML | |
| run: python docs/packages/generate_packages_doc.py | |
| - name: Build with Jekyll | |
| uses: actions/jekyll-build-pages@v1 | |
| with: | |
| source: ./docs | |
| destination: ./_site | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./_site | |
| keep_files: true |