feat: show package version in docs site footer (#35) #24
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: Generate Documentation | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "docs/**" | |
| - "README.md" # feeds the site's home page | |
| - ".github/workflows/generate-docs.yml" | |
| - "src/package_name/**" # rebuild if API docs change | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: docs-pages | |
| cancel-in-progress: true | |
| jobs: | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Set up quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: Install uvr | |
| run: curl -fsSL https://raw.githubusercontent.com/nbafrank/uvr/main/install.sh | sh | |
| - name: Install R (via uvr) | |
| run: uvr r install $(cat .r-version) | |
| - name: Sync project | |
| run: uvr sync --frozen | |
| - name: Install rd2qmd | |
| run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/eitsupi/rd2qmd/releases/latest/download/rd2qmd-installer.sh | sh | |
| - name: Generate API reference (box + rd2qmd) | |
| run: | | |
| uvr run scripts/gen-rd.R | |
| rm -rf docs/reference && mkdir -p docs/reference | |
| rd2qmd convert man/ -f md -o docs/reference/ | |
| rm -rf man | |
| - name: Generate home page content | |
| run: | | |
| # Home page includes README minus its badges block (GitHub-only, not relevant on the docs site) | |
| sed '/<!-- badges: start -->/,/<!-- badges: end -->/d' README.md > docs/_readme.md | |
| - name: Render docs site (Quarto) | |
| run: quarto render docs/ | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: "./docs/html/" | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: docs | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |