-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc7fa33
commit 5ccb207
Showing
7 changed files
with
311 additions
and
72 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,105 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
# Workflow for building and deploying package documentation | ||
name: pkgdown | ||
|
||
on: | ||
push: | ||
branches: [main, master] | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
name: pkgdown | ||
|
||
jobs: | ||
pkgdown: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
R_LIBS_USER: ${{ github.workspace }}/R/library | ||
RETICULATE_PYTHON: ${{ github.workspace }}/.venv/bin/python | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
cache: 'pip' | ||
|
||
- name: Create Python virtual environment | ||
run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
python -m pip install --upgrade pip | ||
pip install numpy>=1.8 pandas>=1.4 matplotlib packaging parameterized tqdm | ||
pip install git+https://github.com/SABS-R3-Epidemiology/epiabm.git@main#egg=pyEpiabm\&subdirectory=pyEpiabm | ||
- name: Set up reticulate configuration | ||
run: | | ||
mkdir -p ~/.R | ||
echo "RETICULATE_PYTHON='${{ github.workspace }}/.venv/bin/python'" >> ~/.R/Makevars | ||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
extra-repositories: https://inla.r-inla-download.org/R/stable | ||
|
||
- name: Install system dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev libharfbuzz-dev libfribidi-dev | ||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::pkgdown, local::., any::XML | ||
extra-packages: | | ||
any::pkgdown | ||
any::XML | ||
any::devtools | ||
any::reticulate | ||
local::. | ||
needs: website | ||
|
||
- name: Check DESCRIPTION file format | ||
run: | | ||
echo "" >> DESCRIPTION # Ensure there's a newline at the end | ||
Rscript -e 'if(length(readLines("DESCRIPTION")) == 0) stop("Empty DESCRIPTION file")' | ||
- name: Configure reticulate | ||
run: | | ||
Rscript -e 'Sys.setenv(RETICULATE_PYTHON = "${{ github.workspace }}/.venv/bin/python")' | ||
Rscript -e 'reticulate::use_virtualenv("${{ github.workspace }}/.venv")' | ||
- name: Build site | ||
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) | ||
shell: Rscript {0} | ||
|
||
run: | | ||
Rscript -e ' | ||
options(pkgdown.internet = FALSE) | ||
pkgdown::build_site_github_pages( | ||
new_process = FALSE, | ||
install = FALSE, | ||
examples = TRUE, | ||
run_dont_run = FALSE | ||
)' | ||
- name: Deploy to GitHub pages | ||
if: github.event_name != 'pull_request' | ||
uses: JamesIves/github-pages-deploy-action@4.1.4 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
clean: false | ||
branch: gh-pages | ||
folder: docs | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload documentation artifacts | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pkgdown-artifacts | ||
path: | | ||
docs/ | ||
pkgdown/ | ||
.venv/ | ||
*.Rcheck/ | ||
*.log |
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
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
Oops, something went wrong.