deploy.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. cache-dependency-path: site/_themes/yarn.lock
  16. - name: Build theme with node
  17. run: |
  18. cd ${{ github.workspace }}/site/_themes
  19. yarn install --frozen-lockfile
  20. yarn build
  21. mv dist/js ../assets/js/themes
  22. cd ../assets/js/themes
  23. FILE=../../../_includes/themes.html
  24. echo "" > $FILE
  25. for f in *.js; do
  26. echo "<script src=/assets/js/themes/$f></script>" >> $FILE
  27. done
  28. - uses: ruby/setup-ruby@v1
  29. with:
  30. ruby-version: 2.6
  31. bundler-cache: true
  32. - name: Build page with Jekyll
  33. run: bundle exec jekyll build
  34. - name: Checkout gh-pages branch
  35. uses: actions/checkout@v3
  36. with:
  37. ref: 'gh-pages'
  38. path: './gh-pages'
  39. - name: Move versions to _gh_pages
  40. run: |
  41. mv gh-pages/versions _gh_pages
  42. rm -rf gh-pages
  43. - name: Deploy to GitHub Pages
  44. uses: JamesIves/github-pages-deploy-action@v4.3.3
  45. with:
  46. branch: gh-pages
  47. folder: _gh_pages