peaceiris/actions-hugo

[BUG REPORT] Generate failed with correct config file

RimuruW opened this issue · 2 comments

Note that an issue which does not follow the template will be closed silently.

Describe the bug

I use the latest Hugo with correct config file place but the action run failed and get the error

Error: Unable to locate config file or config directory. Perhaps you need to create a new site.

However, when I test on my computer, I find it can be generated locally.

$ hugo
Start building sites … 

                   | EN | ZH  
-------------------+----+-----
  Pages            | 69 |  7  
  Paginator pages  |  4 |  0  
  Non-page files   |  1 |  0  
  Static files     | 17 | 17  
  Processed images |  0 |  0  
  Aliases          | 24 |  1  
  Sitemaps         |  2 |  1  
  Cleaned          |  0 |  0  

Total in 268 ms

To confirm if the error caused by git, I delete my local dir and clone the remote repository. It works well by run hugo.

To Reproduce

Use the GitHub Action normally.

Expected behavior

Generate successfully.

Screenshots

Screenshot
Screenshot
Screenshot

Your YAML file

My GitHub Action config file

name: Deploy Hugo

on:
  push:
    branches:
      - master

jobs:
  build-deploy:
    runs-on: ubuntu-18.04
    steps:
      - name: Setup timezone
        uses: zcong1993/setup-timezone@master
        with:
          timezone: Asia/Shanghai
          
      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'
          extended: true

      - name: Build Hugo
        run: |
          hugo version
          hugo --cleanDestinationDir --forceSyncStatic --gc --ignoreCache --minify

      - name: Deploy to Cloudflare Workers
        uses: cloudflare/wrangler-action@1.3.0
        with:
                apiToken: ${{ secrets.CF_WORKERS_TOKEN }}

Additional context

None.

Please read the README and follow the instruction first.

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved.
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.