Feat implement pre commit hooks (#6) #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: Generate Documentation | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "docs/**" | |
| - ".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@v6 | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: "4.5" | |
| - name: Install rv | |
| run: curl -sSL https://raw.githubusercontent.com/A2-ai/rv/refs/heads/main/scripts/install.sh | bash | |
| - name: Sync project | |
| run: rv sync | |
| - name: Run Quartrify | |
| run: Rscript -e "quartify::rtoqmd_dir('src/package_name/', render = TRUE, output_html_dir = '../../docs/html', exclude_pattern='__tests__')" | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| 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@v5 | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |