hugo.yaml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Sample workflow for building and deploying a Hugo site to GitHub Pages
  2. name: Deploy Hugo site to Pages
  3. on:
  4. # Runs on pushes targeting the default branch
  5. push:
  6. branches:
  7. - main
  8. # Allows you to run this workflow manually from the Actions tab
  9. workflow_dispatch:
  10. # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
  11. permissions:
  12. contents: read
  13. pages: write
  14. id-token: write
  15. # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
  16. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
  17. concurrency:
  18. group: "pages"
  19. cancel-in-progress: false
  20. # Default to bash
  21. defaults:
  22. run:
  23. shell: bash
  24. jobs:
  25. # Build job
  26. build:
  27. runs-on: ubuntu-latest
  28. env:
  29. HUGO_VERSION: 0.134.3
  30. steps:
  31. - name: Install Hugo CLI
  32. run: |
  33. wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
  34. && sudo dpkg -i ${{ runner.temp }}/hugo.deb
  35. - name: Install Dart Sass
  36. run: sudo snap install dart-sass
  37. - name: Checkout
  38. uses: actions/checkout@v4
  39. with:
  40. submodules: recursive
  41. fetch-depth: 0
  42. - name: Setup Pages
  43. id: pages
  44. uses: actions/configure-pages@v5
  45. - name: Install Node.js dependencies
  46. run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
  47. - name: Build with Hugo
  48. env:
  49. HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
  50. HUGO_ENVIRONMENT: production
  51. TZ: America/Los_Angeles
  52. run: |
  53. hugo \
  54. --gc \
  55. --minify \
  56. --baseURL "${{ steps.pages.outputs.base_url }}/"
  57. - name: Upload artifact
  58. uses: actions/upload-pages-artifact@v3
  59. with:
  60. path: ./public
  61. # Deployment job
  62. deploy:
  63. environment:
  64. name: github-pages
  65. url: ${{ steps.deployment.outputs.page_url }}
  66. runs-on: ubuntu-latest
  67. needs: build
  68. steps:
  69. - name: Deploy to GitHub Pages
  70. id: deployment
  71. uses: actions/deploy-pages@v4