Cache pip and render slides #12
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 | |
name: Publish | |
permissions: | |
contents: write | |
pages: write | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: "pip" | |
- name: Install Python packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install autocorrect_py panflute pypinyin | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Cache R packages | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ runner.os }}-r-${{ hashFiles('DESCRIPTION') }} | |
restore-keys: ${{ runner.os }}-r- | |
- name: Install R packages | |
run: | | |
Rscript -e "install.packages(c('knitr', 'rmarkdown', 'ggplot2'))" | |
- name: Set up Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
with: | |
version: "pre-release" | |
# tinytex: true | |
- name: Render outputs | |
run: | | |
make docx | |
make html | |
make slides | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./outputs |