Skip to content

GitHub Pages pkgdown site build #134

GitHub Pages pkgdown site build

GitHub Pages pkgdown site build #134

# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples and adapted
on:
push:
branches:
- main
schedule:
- cron: '0 4 * * *'
name: 'GitHub Pages pkgdown site build'
jobs:
build-deploy:
runs-on: ubuntu-latest
container:
image: bioconductor/bioconductor_docker:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} #to push results to gh-pages branch!
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'schedule' && github.ref == 'refs/heads/devel')
steps: #Series of steps that is executed sequencially: https://github.com/r-lib/actions/
- name: Install system dependencies
run: |
apt-get update
apt-get install -y libglpk40 git libxml2-dev libcurl4-openssl-dev libssl-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev cmake rsync
echo "R_VERSION=`R --version | head -n 1 | awk '{print $3}' | cut -b 1-3`" >> $GITHUB_ENV
echo "R_LIBS_USER=`Rscript -e 'cat(.libPaths()[1L])'`" >> $GITHUB_ENV
- uses: actions/checkout@v4 # goes to gh-pages branch to work there
- uses: r-lib/actions/setup-pandoc@v2 #installs pandoc
- name: Set up R dependency cache
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ env.R_VERSION }}
restore-keys: |
${{ runner.os }}-r-${{ env.R_VERSION }}
- name: Install pkgdown & OmnipathR
run: |
Rscript -e 'install.packages("remotes")'
Rscript -e 'install.packages("pkgdown")'
Rscript -e "remotes::install_github('saezlab/OmnipathR@devel')"
- name: Install EnhancedVolcano (not yet in Bioc 3.22)
run: |
Rscript -e 'remotes::install_github("kevinblighe/EnhancedVolcano")'
# Set Bioconductor back to release and install other Bioconductor dependencies
- name: Install other Bioconductor dependencies from release
run: |
Rscript -e 'remotes::install_deps(dependencies = TRUE)'
# ComplexUpset should be installed after ggplot2 to ensure compatibility, especially on Linux/Ubuntu.
- name: Install latest ggplot2
run: Rscript -e 'install.packages("ggplot2", type="source")'
- name: Install ComplexUpset from source
run: Rscript -e 'install.packages("ComplexUpset", type="source")'
- name: Install MetaProViz from GitHub by remotes
run: Rscript -e 'remotes::install_github("saezlab/MetaProViz", dependencies = TRUE)' #we install from GitHub as if we are a random user
- name: Build pkgdown site
run: 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