Size of pages fixed (#101) #198
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: Render and Publish | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: pages-deploy | |
cancel-in-progress: true | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
with: | |
# To install LaTeX to build PDF book | |
tinytex: true | |
# uncomment below and fill to pin a version | |
# version: 0.9.600 | |
# add software dependencies here | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Install system dependencies | |
run: sudo apt-get install -y libcurl4-openssl-dev | |
- name: Cache Renv packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/R/Library | |
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | |
restore-keys: | | |
${{ runner.os }}-renv- | |
- name: Restore R package dependencies with renv | |
run: | | |
Rscript -e "install.packages('renv')" | |
Rscript -e "renv::restore()" | |
# set the file modification times to the time of the last commit for every file | |
# This did not work as expected, so deactivated. But left in case we want to come back to it. | |
# - name: Fix timestamps | |
# run: bash .github/scripts/fix-timestamps.sh | |
- name: Install Barlow font | |
run: | | |
mkdir -p ~/.local/share/fonts | |
wget -qO- https://github.com/google/fonts/raw/main/ofl/barlow/Barlow-Regular.ttf > ~/.local/share/fonts/Barlow-Regular.ttf | |
wget -qO- https://github.com/google/fonts/raw/main/ofl/barlow/Barlow-Bold.ttf > ~/.local/share/fonts/Barlow-Bold.ttf | |
fc-cache -f -v | |
- name: Publish to GitHub Pages (and render) | |
uses: quarto-dev/quarto-actions/publish@v2 | |
with: | |
target: gh-pages | |
env: | |
QUARTO_PROFILE: html | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Render PDF | |
# uses: quarto-dev/quarto-actions/render@v2 | |
# with: | |
# to: pdf | |
# path: . | |
# env: | |
# QUARTO_PROFILE: pdf | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Manually Render PDF | |
run: quarto render --profile pdf --output-dir _book | |
# Debug: List files after rendering PDF | |
- name: List files after rendering PDF | |
run: | | |
ls -l | |
find . -name "*.pdf" | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
# Copy the PDF to the gh-pages directory | |
- name: Copy PDF to gh-pages directory | |
run: | | |
cp ./_book/*.pdf gh-pages/ | |
# Debug: List files in gh-pages directory | |
- name: List files in gh-pages directory | |
run: | | |
ls -l gh-pages | |
find gh-pages -name "*.pdf" | |
- name: Commit and Push PDF to gh-pages | |
working-directory: ./gh-pages | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "GitHub Action" | |
git add -f *.pdf | |
git commit -m "Automatically generated PDF" -a || echo "No changes to commit" | |
git push origin gh-pages |