peaceiris / actions-hugo

GitHub Actions for Hugo ⚡️ Setup Hugo quickly and build your site fast. Hugo extended, Hugo Modules, Linux (Ubuntu), macOS, and Windows are supported.
https://github.com/marketplace/actions/hugo-setup
MIT License
1.38k stars 80 forks source link

support: Docsy Theme can not be built. #547

Closed Xu-Xihe closed 2 years ago

Xu-Xihe commented 2 years ago

Checklist

Describe the bug

I have fork the docsy-example site and just copy the template for it in th README.md file. I only changed the on: branches from main to master. But after I pushed,it doesn't work.The Github Actions has showed me a '×',but I dont now why.

Relevant links

Public repository:https://github.com/Xu-Xihe/docsy-example
YAML config:
YAML workflow:

Relevant log output

Run npm ci npm ci shell: /usr/bin/bash -e {0} npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.

npm ERR! A complete log of this run can be found in: npm ERR! /home/runner/.npm/_logs/2021-10-19T14_53_22_563Z-debug.log Error: Process completed with exit code 1.

Additional context.

NO.

peaceiris commented 2 years ago

Why don't you put your package-lock.json under Git control?

  1. Delete package-lock.json from .gitignore
  2. Create your package-lock.json file with npm install on your local machine
  3. Git add, commit, and push the changes of package-lock.json and .gitignore
Xu-Xihe commented 2 years ago

你为什么不把你的package-lock.json在 Git 控制之下?

  1. 删除package-lock.json.gitignore
  2. 在本地机器上创建package-lock.json文件npm install
  3. Git的添加,提交和推变化package-lock.json.gitignore

Yeah,I soon noticed it.But there still a problom that the Docsy-examples don't upload its package-lock.json to the repo. I have already solved this problem now,but a small suggestion: maybe mark out this to the 'README.md'. If someone followed the tips from the Docsy,maybe they will upload the same .gitignore.(someone like me don't know npm very well)

peaceiris commented 2 years ago

I have opened https://github.com/google/docsy-example/pull/140

This pull-request will help other users. Thanks!

peaceiris commented 2 years ago

Notes for newbies of npm,

I have closed https://github.com/google/docsy-example/pull/140. They seem to introduce the use of npm install for newbies of npm and put package-lock.json out of Git control.

You can use npm install on your CI workflow without doing so. But in that case, your workflow will take much more time than using npm ci and there is no reproducibility. npm ci is the best way on CI/CD pipelines. To make your project stable and deployment speed fast, use package-lock.json and npm ci. For more details about it, see the official documentation: npm ci | npm Docs.

github-actions[bot] commented 2 years ago

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.

Log | Bot Usage