CaiJimmy / hugo-theme-stack

Card-style Hugo theme designed for bloggers
https://stack.jimmycai.com
GNU General Public License v3.0
5.06k stars 1.66k forks source link

[Bug]: According repo hugo-theme-stack-starter #820

Closed 3kis closed 1 year ago

3kis commented 1 year ago

What happened?

如何解决构建失败的问题

How to resolve build failures? according the ‘To get started’ steps in repo hugo-theme-stack-starter: after creating codespace associated with the my repo which is created by the first step, workflow occur a error : image

the workflow file is below:

name: Deploy to Github Pages

on:
    push:
        branches: [master]
    pull_request:
        branches: [master]

jobs:
    build:
        runs-on: ubuntu-latest

        steps:
            - uses: actions/checkout@v2

            - name: Cache Hugo resources
              uses: actions/cache@v2
              env:
                  cache-name: cache-hugo-resources
              with:
                  path: resources
                  key: ${{ env.cache-name }}

            - uses: actions/setup-go@v2
              with:
                  go-version: "^1.17.0"
            - run: go version

            - name: Cache Go Modules
              uses: actions/cache@v2
              with:
                  path: |
                      ~/.cache/go-build
                      ~/go/pkg/mod
                  key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
                  restore-keys: |
                      ${{ runner.os }}-go-
            - name: Setup Hugo
              uses: peaceiris/actions-hugo@v2
              with:
                  hugo-version: "latest"
                  extended: true

            - name: Build
              run: hugo --minify --gc

            - name: Deploy 🚀
              uses: JamesIves/github-pages-deploy-action@4.1.4
              with:
                  branch: gh-pages
                  folder: public
                  clean: true
                  single-commit: true

Hugo version

latest

Theme version

latest

What browsers are you seeing the problem on?

No response

More information about the browser

No response

Relevant log output

No response

Link to the page with bug

https://demo.stack.jimmycai.com

Link to the source repository

No response

aster-hu commented 1 year ago

Edit: Sorry I just noticed your error code is different than mine so this may not work for you.

I had the same problem and it seems like an issue caused by Hugo's latest release v0.112.x.

Changing the Hugo version back to v0.111.3 solved the issue for me.

            - name: Setup Hugo
              uses: peaceiris/actions-hugo@v2
              with:
                  hugo-version: 0.111.3
                  extended: true
CaiJimmy commented 1 year ago

This should be already fixed with https://github.com/CaiJimmy/hugo-theme-stack-starter/commit/11da5cc8a961ad23e841a68f9672e2386dc22f4a

Thank you for reporting!