name: Publish Hugo site on: push: branches: ["main"] paths: - "site/**" - ".github/workflows/publish-hugo.yml" workflow_dispatch: concurrency: group: deploy-gh-pages cancel-in-progress: true permissions: contents: write jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout main uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: hugo-version: "0.125.7" extended: true - name: Build run: hugo --source site --minify --destination ../hugo-output - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./hugo-output publish_branch: gh-pages destination_dir: docs keep_files: false force_orphan: true cname: blog.xsltplayground.com