ci: try to set env variables differently #64
This file contains 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: pkgdown | |
on: | |
push: | |
branches: | |
- jomain | |
# on: | |
# repository_dispatch: | |
# types: [trigger-workflow-2] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
container: rformassspectrometry/metabonaut:latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
## Set the R library to the directory matching the | |
## R packages cache step further below when running on Docker (Linux). | |
- name: Set R Library home on Linux | |
if: runner.os == 'Linux' | |
run: | | |
mkdir /__w/_temp/Library | |
mkdir /__w/Rtmp | |
echo ".libPaths('/__w/_temp/Library')" > ~/.Rprofile | |
- name: Checkout package | |
uses: actions/checkout@v4 | |
- name: Verify Quarto Installation | |
run: quarto --version | |
- name: Install rcmdcheck | |
run: | | |
install.packages('rcmdcheck') | |
shell: Rscript {0} | |
# - name: Check | |
# env: | |
# _R_CHECK_CRAN_INCOMING_REMOTE_: false | |
# run: | | |
# Rscript -e "rcmdcheck::rcmdcheck(args = c('--no-manual'), error_on = 'error', check_dir = 'check')" | |
# shell: bash {0} | |
- name: Install deploy dependencies | |
run: | | |
apt-get update | |
apt-get -y install rsync | |
- name: Install pkgdown | |
if: github.ref == 'refs/heads/main' | |
run: | | |
install.packages('pkgdown') | |
shell: Rscript {0} | |
- name: Install package | |
if: github.ref == 'refs/heads/main' | |
run: R CMD INSTALL . | |
# - name: Build site | |
# env: | |
# QUARTO_PRINT_STACK: true | |
# QUARTO_LOG_LEVEL: DEBUG | |
# run: | | |
# install.packages("unixtools", repos = "http://www.rforge.net/") | |
# unixtools::set.tempdir("/__w/Rtmp") | |
# pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) | |
# shell: Rscript {0} | |
- name: Build site | |
run: | | |
export QUARTO_PRINT_STACK=true | |
export QUARTO_LOG_LEVEL=DEBUG | |
Rscript -e "install.packages('unixtools', repos = 'http://www.rforge.net/')" | |
Rscript -e "unixtools::set.tempdir('/__w/Rtmp')" | |
Rscript -e "pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)" | |
shell: Rscript {0} | |
- name: Deploy to GitHub pages 🚀 | |
if: github.event_name != 'pull_request' | |
uses: JamesIves/[email protected] | |
with: | |
clean: false | |
branch: gh-pages | |
folder: docs | |
## Note that you need to run pkgdown::deploy_to_branch(new_process = FALSE) | |
## at least one locally before this will work. This creates the gh-pages | |
## branch (erasing anything you haven't version controlled!) and | |
## makes the git history recognizable by pkgdown. |