Build Pkgdown #717
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
| on: | |
| workflow_run: | |
| workflows: ["Render, deploy site"] | |
| types: | |
| - completed | |
| schedule: | |
| # run every day at 11 PM | |
| - cron: '0 23 * * *' | |
| name: Build Pkgdown | |
| jobs: | |
| R-CMD-check: | |
| runs-on: ${{ matrix.config.os }} | |
| name: ${{ matrix.config.package }} ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
| strategy: | |
| max-parallel: 1 | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - {os: macOS-latest, r: 'release', package: 'declaredesign', branch: 'main'} | |
| - {os: macOS-latest, r: 'release', package: 'fabricatr', branch: 'main'} | |
| - {os: macOS-latest, r: 'release', package: 'randomizr', branch: 'main'} | |
| - {os: macOS-latest, r: 'release', package: 'estimatr', branch: 'main'} | |
| - {os: macOS-latest, r: 'release', package: 'rdss', branch: 'main'} | |
| - {os: macOS-latest, r: 'release', package: 'designlibrary', branch: 'master'} | |
| env: | |
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
| RSPM: ${{ matrix.config.rspm }} | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| ABORT_ON_MISSING_TOPICS: FALSE | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.config.r }} | |
| http-user-agent: ${{ matrix.config.http-user-agent }} | |
| - uses: r-lib/actions/setup-pandoc@v2 | |
| - name: Install packages | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| cache: always | |
| - name: Session info | |
| run: | | |
| options(width = 100) | |
| pkgs <- installed.packages()[, "Package"] | |
| sessioninfo::session_info(pkgs, include_base = TRUE) | |
| shell: Rscript {0} | |
| - name: Clone all DD packages | |
| run: | | |
| git clone -b ${{ matrix.config.branch }} https://github.com/DeclareDesign/${{ matrix.config.package }} pkg | |
| - name: Search for dependences in docs | |
| run: Rscript -e 'library(checkpoint); found_packages <- scan_project_files(".", scan_rnw_with_knitr = TRUE)$pkgs; if(length(found_packages[!found_packages%in% installed.packages()[, 1]]) > 0) install.packages(found_packages[!found_packages%in% installed.packages()[,1]], repos = "https://cran.r-project.org")' | |
| - name: Build site | |
| run: pkgdown::build_site(pkg = "pkg") | |
| shell: Rscript {0} | |
| - name: Push to gh-pages | |
| if: github.ref == 'refs/heads/main' | |
| uses: JamesIves/github-pages-deploy-action@v4.5.0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: gh-pages | |
| folder: 'pkg/docs' | |
| target-folder: 'r/${{ matrix.config.package }}' | |
| clean: true | |