From 54b6804061de2b0c485446d7173aa9251a870910 Mon Sep 17 00:00:00 2001 From: eric Liu Date: Wed, 12 Jun 2024 03:44:12 +0000 Subject: [PATCH] Update .gitea/workflows/publish.yaml --- .gitea/workflows/publish.yaml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/publish.yaml b/.gitea/workflows/publish.yaml index 79809cc..0c0e802 100644 --- a/.gitea/workflows/publish.yaml +++ b/.gitea/workflows/publish.yaml @@ -12,6 +12,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + submodules: true # Fetch Hugo themes (true OR recursive) + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - name: Set up SSH run: | @@ -26,22 +29,20 @@ jobs: find output -mindepth 1 -not -regex "^.*\/.git\/.*" -delete - name: Build site with Hugo - uses: peaceiris/actions-hugo@v2 + uses: peaceiris/actions-hugo@v3 with: - hugo-version: '0.97.0' - extended: true + hugo-version: '0.119.0' + # extended: true - - name: Add commit hash to index.html - run: | - sed -i 's/\[commit\]/\[${{ github.sha::0:7 }}\]/g' output/index.html + - name: Build + run: hugo --minify - - name: Push changes to gitea-pages branch - uses: ad-m/github-push-action@v0.6.0 + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/main' }} with: - branch: gitea-pages - github_token: ${{ secrets.token }} - force: true - message: "Drone build ${{ github.sha::0:7 }}" + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public - name: Delete Kubernetes pod run: |