CaiJimmy / hugo-theme-stack-starter

A quickstart template to create a Hugo blog using hugo-theme-stack
https://demo.stack.jimmycai.com
MIT License
306 stars 105 forks source link

build error #20

Closed 3kis closed 11 months ago

3kis commented 1 year ago

according the ‘To get started’ steps: after creating codespace associated with repo, 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
Nasjoe commented 1 year ago

Same here :

Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2, actions/cache@v2, actions/setup-go@v2. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

CaiJimmy commented 1 year ago

The temporary solution is to use Hugo 0.111.x in GitHub action while this gets fixed by Hugo: https://github.com/CaiJimmy/hugo-theme-stack/issues/821#issue-1723121447

3kis commented 1 year ago

oh, thanks !

CaiJimmy commented 11 months ago

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

The reason was that GitHub changed the default permission for GitHub Actions to read-only.