Skip to content

pdf in download menu #200

pdf in download menu

pdf in download menu #200

Workflow file for this run

name: 📖 Bookdown
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- 'README.md'
jobs:
bookdown:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.2.0'
- name: Install Pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Install TinyTeX
uses: r-lib/actions/setup-tinytex@v2
env:
TINYTEX_INSTALLER: TinyTeX
- name: Install R dependencies
uses: r-lib/actions/setup-renv@v2
with:
cache-version: 1
- name: Get commit hash
id: hash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Replace commit hash
run: |
sed -i "s/GIT_COMMIT_HASH/${{ steps.hash.outputs.sha_short }}/g" ./index.Rmd
- name: Build site
run: |
R -e "bookdown::render_book('index.Rmd','bookdown::pdf_book',config_file='_bookdown.yml')"
R -e "bookdown::render_book('index.Rmd','bookdown::gitbook',config_file='_bookdown.yml')"
- name: Deploy to build branch
uses: JamesIves/github-pages-deploy-action@3.6.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: build
FOLDER: book