deploy.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. name: Deploy on Github Pages
  2. on:
  3. push:
  4. branches:
  5. - master
  6. # Allows you to run this workflow manually from the Actions tab
  7. workflow_dispatch:
  8. # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
  9. permissions:
  10. contents: read
  11. pages: write
  12. id-token: write
  13. # Allow one concurrent deployment
  14. concurrency:
  15. group: "pages"
  16. cancel-in-progress: true
  17. # Default to bash
  18. defaults:
  19. run:
  20. shell: bash
  21. jobs:
  22. build:
  23. runs-on: ubuntu-22.04
  24. steps:
  25. - uses: actions/checkout@v3
  26. with:
  27. submodules: true # Fetch Hugo themes (true OR recursive)
  28. fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
  29. - name: Setup Pages
  30. id: pages
  31. uses: actions/configure-pages@v2
  32. - name: Setup Hugo
  33. uses: peaceiris/actions-hugo@v2
  34. with:
  35. hugo-version: "0.124.1"
  36. extended: true
  37. - name: Setup Node
  38. uses: actions/setup-node@v3
  39. with:
  40. node-version: '20'
  41. cache: 'npm'
  42. cache-dependency-path: '**/package-lock.json'
  43. - name: Install Node dependencies
  44. run: npm ci
  45. - name: Build
  46. run: hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
  47. - name: Upload artifact
  48. uses: actions/upload-pages-artifact@v1
  49. with:
  50. path: ./public
  51. # Deployment job
  52. deploy:
  53. environment:
  54. name: github-pages
  55. url: ${{ steps.deployment.outputs.page_url }}
  56. runs-on: ubuntu-latest
  57. needs: build
  58. steps:
  59. - name: Deploy to GitHub Pages
  60. id: deployment
  61. uses: actions/deploy-pages@v1