Skip to content

Merge remote-tracking branch 'origin/dev-percyfal' into dev-percyfal #334

Merge remote-tracking branch 'origin/dev-percyfal' into dev-percyfal

Merge remote-tracking branch 'origin/dev-percyfal' into dev-percyfal #334

Workflow file for this run

name: build
on:
pull_request:
branches:
- main
workflow_dispatch:
push:
branches:
- 'main'
- 'test-build'
tags:
- "v*"
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 }}
- name: Render tag and save rendered state in separate branch
if: startsWith(github.ref, 'refs/tags/v')
with:
target: ${{ github.ref_name }}
path: docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Checkout archived course versions
# env:
# GITHUB_EMAIL: [email protected]
# GITHUB_USERNAME: gh_action
# TARGET: gh_pages
# run: |
# # Add git info
# git config --global user.email "${{ env.GITHUB_EMAIL }}"
# git config --global user.name "${{ env.GITHUB_USERNAME }}"
# git clone --single-branch --branch ${{ env.TARGET }} "https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" tmprepo
# cd tmprepo
# mkdir -p archive
# cd archive
# git branch -l
# ls -lh
# # Add archive index page
# cat .header.html > index.html
# # Loop tags that match v\d+
# for tag in $(git tag --list v[0-9][0-9][0-9][0-9]); do
# if [ -d $tag ]; then
# echo "Directory ${tag} already exsists. Removing"
# git clone --depth 1 --branch $tag "https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" $tag
# contents=$(git tag -n 100 $tag --format "%(contents)")
# echo "<section id=\"$tag\" class=\"level3\">" >> index.html
# echo "<h3 class=\"anchored\" data-anchor-id=\"$tag\">" >> index.html
# echo "<a href=\"$link\">$tag</a>" >> index.html
# echo "</h3>" >> index.html
# echo "<p>$contents</p>" >> index.html
# echo "</section>" >> index.html
# done
# cat .footer.html >> index.html