deploy.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Deploy Site
  2. on:
  3. push:
  4. branches:
  5. - master
  6. jobs:
  7. deploy:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v3
  11. - uses: actions/setup-node@v3
  12. with:
  13. node-version: 16
  14. cache: 'yarn'
  15. - name: Build theme with node
  16. run: |
  17. cd ${{ github.workspace }}/site/_themes
  18. yarn install --frozen-lockfile
  19. yarn build
  20. mv dist/js ../assets/js/themes
  21. cd ../assets/js/themes
  22. FILE=../../../_includes/themes.html
  23. echo "" > $FILE
  24. for f in *.js; do
  25. echo "<script src=/assets/js/themes/$f></script>" >> $FILE
  26. done
  27. - uses: ruby/setup-ruby@v1
  28. with:
  29. ruby-version: 2.6
  30. bundler-cache: true
  31. - name: Build page with Jekyll
  32. run: bundle exec jekyll build
  33. - name: Checkout gh-pages branch
  34. uses: actions/checkout@v3
  35. with:
  36. ref: 'gh-pages'
  37. path: './gh-pages'
  38. - name: Move versions to _gh_pages
  39. run: |
  40. mv gh-pages/versions _gh_pages
  41. rm -rf gh-pages
  42. - name: Deploy to GitHub Pages
  43. uses: JamesIves/github-pages-deploy-action@v4.3.3
  44. with:
  45. branch: gh-pages
  46. folder: _gh_pages