build: add docs generation for the dev branch #1
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: Build development documentation | |
| on: | |
| push: | |
| branches: [dev] | |
| workflow_dispatch: | |
| concurrency: | |
| group: altdoc-pages | |
| cancel-in-progress: false | |
| permissions: read-all | |
| jobs: | |
| altdoc-dev: | |
| if: github.ref == 'refs/heads/dev' | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| R_KEEP_PKG_SOURCE: yes | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-pandoc@v2 | |
| - uses: quarto-dev/quarto-actions/setup@v2 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| cache-dependency-path: altdoc/requirements.txt | |
| - name: Install MkDocs | |
| run: | | |
| python -m venv .venv_altdoc | |
| .venv_altdoc/bin/python -m pip install --requirement altdoc/requirements.txt | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: local::. | |
| needs: website | |
| - name: Configure development preview | |
| run: | | |
| sed -i 's#https://immunomind.github.io/immundata/#https://immunomind.github.io/immundata/dev/#g' altdoc/mkdocs.yml altdoc/pkgdown.yml README.md | |
| sed -i 's/^site_name: immundata$/site_name: immundata dev/' altdoc/mkdocs.yml | |
| - name: Build site | |
| run: altdoc::render_docs(freeze = FALSE, parallel = FALSE, verbose = TRUE) | |
| shell: Rscript {0} | |
| - name: Deploy development preview | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| clean: true | |
| branch: gh-pages | |
| folder: docs | |
| target-folder: dev |