push on devel #154
Workflow file for this run
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
on: | |
push: | |
branches: [main,devel] | |
pull_request: | |
branches: [main,devel] | |
name: Book-Ubuntu | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-22.04 | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
PANDOC_VERSION: "3.1.11" | |
RETICULATE_PYTHON_ENV: /opt/.virtualenvs/r-tensorflow | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
with: | |
version: 1.4.555 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
r-version: '4.4.1' | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
- name: Install Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
with: | |
pandoc-version: ${{ env.PANDOC_VERSION }} | |
- name: Install TinyTeX | |
uses: r-lib/actions/setup-tinytex@v2 | |
env: | |
# install full prebuilt version | |
TINYTEX_INSTALLER: TinyTeX | |
- name: Setup Python | |
run: | | |
pip3 install virtualenv | |
mkdir -p /opt/.virtualenvs/r-tensorflow | |
virtualenv -p /usr/bin/python3 $RETICULATE_PYTHON_ENV | |
source $RETICULATE_PYTHON_ENV/bin/activate | |
pip3 install -r requirements.txt | |
deactivate | |
- name: Install Fonts From System | |
run: | | |
sudo apt-get install -y ghostscript graphviz optipng | |
sudo apt-get install -y fonts-noto-core fonts-noto-cjk | |
mkdir -p ~/.fonts/ | |
curl -fLo xkcd.ttf http://simonsoftware.se/other/xkcd.ttf | |
cp xkcd.ttf ~/.fonts/ | |
fc-list | grep 'noto' | sort | |
fc-list | sort | |
- name: Install LaTeX packages | |
run: | | |
if(!require('tinytex')) install.packages('tinytex') | |
tinytex::tlmgr_install(readLines("texlive.txt")) | |
tinytex::tl_pkgs() | |
tikzDevice::tikzTest("m", engine = "xetex") | |
tikzDevice::tikzTest("$\\sin(x^2/2 - y^2/4 + 3) \\cos(2 x + 1 - \\exp(y))$") | |
shell: Rscript {0} | |
- name: Setup magick | |
run: | | |
sudo sed -i_bak \ | |
's/name="disk" value="1GiB"/name="disk" value="8GiB"/' \ | |
/etc/ImageMagick-6/policy.xml | |
- name: Render Book | |
run: | | |
source $RETICULATE_PYTHON_ENV/bin/activate | |
quarto check | |
quarto render --to html | |
shell: bash | |
env: | |
RETICULATE_PYTHON_ENV: /opt/.virtualenvs/r-tensorflow | |
RETICULATE_PYTHON: /opt/.virtualenvs/r-tensorflow/bin/python | |
- name: Deploy book to bookdown.org | |
if: github.event_name == 'push' | |
env: | |
CONNECT_API_KEY: ${{ secrets.RSC_BOOKDOWN_ORG_TOKEN }} | |
CONTENT_ID: 8172 | |
run: | | |
Rscript '_deploy-book.R' | |
- name: Checkout the gh-pages branch | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: book-output | |
- name: Deploy to Github Pages | |
if: ${{ github.ref == 'refs/heads/devel' }} | |
run: ./_deploy.sh |