deploy.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: Deploy on Github Pages
  2. on:
  3. push:
  4. branches:
  5. - main
  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.130.0"
  36. extended: true
  37. - name: Build
  38. run: hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
  39. - name: Upload artifact
  40. uses: actions/upload-pages-artifact@v1
  41. with:
  42. path: ./public
  43. # Deployment job
  44. deploy:
  45. environment:
  46. name: github-pages
  47. url: ${{ steps.deployment.outputs.page_url }}
  48. runs-on: ubuntu-latest
  49. needs: build
  50. steps:
  51. - name: Deploy to GitHub Pages
  52. id: deployment
  53. uses: actions/deploy-pages@v1