Dev percyfal #240
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: build | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
- 'test-build' | |
tags: | |
- "*" | |
env: | |
PARTICIPANT_DATA: | |
jobs: | |
build: | |
name: Build site | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
permissions: | |
contents: write | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Cancel Previous Runs | |
if: ${{ !env.ACT }} | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
micromamba-version: "1.3.1-0" | |
environment-file: conda-linux-64.lock | |
environment-name: pgip | |
init-shell: bash | |
cache-environment: true | |
- name: Install pgip dependencies | |
run: | | |
python -m ipykernel install --user --name pgip --display-name "Population Genomics in Practice (Python)" | |
python -m pip install git+https://github.com/NBISweden/pgip-tools | |
python -m pip install git+https://github.com/ksamuk/pixy.git | |
- name: Install dotenv | |
run: | | |
R -e "install.packages('dotenv', repos=c(CRAN = 'https://cran.rstudio.com/'))" | |
- name: Install TeXLive | |
run: | | |
sudo apt-get update | |
sudo apt-get install texlive texlive-latex-extra | |
- name: Install local pgip R package | |
run: | | |
R -e "library(devtools); devtools::install_local('src/R/pgip', upgrade=F)" | |
- name: Setup Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
with: | |
version: 1.3.450 | |
- run: | | |
quarto --version | |
- name: Add miniconda path | |
run: | | |
echo "$(dirname $(which R))" >> $GITHUB_PATH | |
quarto check | |
- name: "Set environment variables" | |
run: | | |
echo "TEXINPUTS=$TEXINPUTS:$GITHUB_WORKSPACE/src/latex" >> $GITHUB_ENV | |
- name: Install dvisvgm | |
run: | | |
sudo apt-get install dvisvgm | |
- name: Render project without publishing | |
uses: quarto-dev/quarto-actions/render@v2 | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
path: docs | |
- name: Publish to GitHub Pages | |
uses: quarto-dev/quarto-actions/publish@v2 | |
if: ${{ github.ref_name == 'main' || github.ref_name == 'test-build' }} | |
with: | |
target: gh-pages | |
path: docs | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |