From edb947587ef27c1bab683a099e69b605493fd313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilmantas=20G=C4=97g=C5=BEna?= Date: Thu, 28 Jul 2022 14:51:20 +0300 Subject: [PATCH] Update pkgdown.yaml --- .github/workflows/pkgdown.yaml | 44 ++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 460418d3..2d458048 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -26,16 +26,50 @@ jobs: use-public-rspm: true r-version: 'release' - - uses: r-lib/actions/setup-r-dependencies@v2 + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + uses: actions/cache@v2 with: - extra-packages: any::pkgdown, local::. - extra-repositories: https://mokymai.github.io/download/ - needs: website + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + remotes::install_cran(c("rmarkdown", "devtools", "pkgdown", "ps")) + remotes::install_deps(dependencies = TRUE) + shell: Rscript {0} + + - name: Configure Git + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + - name: Roxygenize + # The vignettes will be built in step "Deploy package" + run: | + devtools::document(roclets = c('rd', 'collate', 'namespace')) + shell: Rscript {0} + + - name: Commit documentation updates + run: | + git add --all + git commit -m 'Re-build documentation' || echo "No changes to commit" + git push origin || echo "No changes to commit (documentation)" + + - name: Install package + run: R CMD INSTALL . - name: Render README run: Rscript -e 'rmarkdown::render("README.Rmd")' - - name: Commit (if README was changed) + - name: Commit README (if README was changed) run: | git commit README.md -m 'Re-build README.Rmd before pkgdown' || echo "No changes to commit (README)" git push origin || echo "No changes to commit (README)"