bookdown.yaml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. on:
  2. push:
  3. branches:
  4. - main
  5. name: renderbook
  6. jobs:
  7. bookdown:
  8. name: Render-Book
  9. runs-on: macOS-latest
  10. steps:
  11. - uses: actions/checkout@v1
  12. - uses: r-lib/actions/setup-r@v1
  13. - uses: r-lib/actions/setup-pandoc@v1
  14. - name: Install rmarkdown
  15. run: Rscript -e 'install.packages(c("rmarkdown","bookdown", "ggplot2", "lattice", "XML"))'
  16. - name: Render Book
  17. run: Rscript -e 'bookdown::render_book("index.Rmd")'
  18. - name: cp .github
  19. run: cp .github/CNAME _book/CNAME
  20. - uses: actions/upload-artifact@v1
  21. with:
  22. name: _book
  23. path: _book/
  24. # Need to first create an empty gh-pages branch
  25. # see https://pkgdown.r-lib.org/reference/deploy_site_github.html
  26. # and also add secrets for a GH_PAT and EMAIL to the repository
  27. # gh-action from Cecilapp/GitHub-Pages-deploy
  28. checkout-and-deploy:
  29. runs-on: ubuntu-latest
  30. needs: bookdown
  31. steps:
  32. - name: Checkout
  33. uses: actions/checkout@master
  34. - name: Download artifact
  35. uses: actions/[email protected]
  36. with:
  37. # Artifact name
  38. name: _book # optional
  39. # Destination path
  40. path: _book # optional
  41. - name: Deploy to GitHub Pages
  42. uses: Cecilapp/GitHub-Pages-deploy@v3
  43. env:
  44. GITHUB_TOKEN: ${{ secrets.GH_PAT }} # https://github.com/settings/tokens
  45. with:
  46. EMAIL: ${{ secrets.EMAIL }} # must be a verified email
  47. BUILD_DIR: _book # "_site/" by default