hugo.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Based on the 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: ["master"]
  7. # Allows you to run this workflow manually from the Actions tab
  8. workflow_dispatch:
  9. # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
  10. permissions:
  11. contents: read
  12. pages: write
  13. id-token: write
  14. # Allow one concurrent deployment
  15. concurrency:
  16. group: "pages"
  17. cancel-in-progress: true
  18. jobs:
  19. # Build job
  20. build:
  21. runs-on: ubuntu-latest
  22. env:
  23. HUGO_VERSION: 0.130.0
  24. steps:
  25. - name: Install Hugo CLI
  26. run: |
  27. wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
  28. && sudo dpkg -i ${{ runner.temp }}/hugo.deb
  29. - name: Checkout
  30. uses: actions/checkout@v4
  31. with:
  32. submodules: recursive
  33. - name: Setup Pages
  34. id: pages
  35. uses: actions/configure-pages@v5
  36. - name: Build with Hugo
  37. env:
  38. # For maximum backward compatibility with Hugo modules
  39. HUGO_ENVIRONMENT: production
  40. HUGO_ENV: production
  41. run: |
  42. hugo \
  43. --minify \
  44. --baseURL "${{ steps.pages.outputs.base_url }}/" \
  45. -s "./exampleSite/" \
  46. --themesDir "../../"
  47. - name: Upload artifact
  48. uses: actions/upload-pages-artifact@v3
  49. with:
  50. path: ./exampleSite/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. if: >
  62. success()
  63. && github.ref == 'refs/heads/master'
  64. && github.repository == 'halogenica/beautifulhugo'
  65. uses: actions/deploy-pages@v4