在GitHub上发布我的网站(HTML)时出现了publish.yml中的错误。

huangapple go评论126阅读模式
英文:

error in publish.yml to publish my site on GitHub (html)

问题

我正在尝试在GitHub上发布我的HTML文档,但当我更改文档时,GitHub上的文档没有变化。所以我创建了一个工作流程和一个publish.yml文档,并写入以下内容:

  1. on:
  2. workflow_dispatch:
  3. push:
  4. branches: main
  5. name: Quarto Publish
  6. jobs:
  7. build-deploy:
  8. runs-on: ubuntu-latest
  9. permissions:
  10. contents: write
  11. steps:
  12. - name: Check out repository
  13. uses: actions/checkout@v3
  14. - name: Set up Quarto
  15. uses: quarto-dev/quarto-actions/setup@v2
  16. - name: Render and Publish
  17. uses: quarto-dev/quarto-actions/publish@v2
  18. with:
  19. target: gh-pages
  20. env:
  21. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

我遇到了以下错误:

  1. Jupyter is not available in this Python installation.
  2. 50
  3. Install with python3 -m pip install jupyter
  4. 51
  5. 52
  6. ERROR: Error
  7. 53
  8. at renderFiles (file:///opt/quarto/bin/quarto.js:86658:30)
  9. 54
  10. at async render (file:///opt/quarto/bin/quarto.js:90681:21)
  11. 55
  12. at async renderForPublish (file:///opt/quarto/bin/quarto.js:121247:33)
  13. 56
  14. at async renderForPublish (file:///opt/quarto/bin/quarto.js:109089:24)
  15. 57
  16. at async Object.publish4 [as publish] (file:///opt/quarto/bin/quarto.js:120459:26)
  17. 58
  18. at async publishDocument (file:///opt/quarto/bin/quarto.js:121349:38)
  19. 59
  20. at async publish5 (file:///opt/quarto/bin/quarto.js:121445:132)
  21. 60
  22. at async doPublish (file:///opt/quarto/bin/quarto.js:121401:13)
  23. 61
  24. at async publishAction (file:///opt/quarto/bin/quarto.js:121412:9)
  25. 62
  26. at async Command.fn (file:///opt/quarto/bin/quarto.js:121389:9)
  27. 63
  28. Error: Process completed with exit code 1.

我尝试在以下位置更改文件:

  1. on:
  2. workflow_dispatch:
  3. push:
  4. branches: main
  5. name: Quarto Publish
  6. jobs:
  7. build-deploy:
  8. runs-on: ubuntu-latest
  9. permissions:
  10. contents: write
  11. steps:
  12. - name: Check out repository
  13. uses: actions/checkout@v3
  14. - name: Set up Quarto
  15. uses: quarto-dev/quarto-actions/setup@v2
  16. - name: Install Python and Dependencies
  17. uses: actions/setup-python@v4
  18. with:
  19. python-version: '3.10'
  20. cache: 'pip'
  21. - run: pip install jupyter
  22. - run: pip install -r requirements.txt
  23. - name: Render and Publish
  24. uses: quarto-dev/quarto-actions/publish@v2
  25. with:
  26. target: gh-pages
  27. env:
  28. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

我遇到了以下错误:

  1. Error: No file in /home/runner/work/Crowdsourcing/Crowdsourcing matched to [**/requirements.txt or **/pyproject.toml], make sure you have checked out the target repository

我没有requirements.txt文件,也不需要它,所以我不知道如何修复这个问题。

英文:

I'm trying to publish my html document on GitHub but when I change the document it doesn't change on GitHub. So I did a workflow and a publish.yml document and write this :

  1. on:
  2. workflow_dispatch:
  3. push:
  4. branches: main
  5. name: Quarto Publish
  6. jobs:
  7. build-deploy:
  8. runs-on: ubuntu-latest
  9. permissions:
  10. contents: write
  11. steps:
  12. - name: Check out repository
  13. uses: actions/checkout@v3
  14. - name: Set up Quarto
  15. uses: quarto-dev/quarto-actions/setup@v2
  16. - name: Render and Publish
  17. uses: quarto-dev/quarto-actions/publish@v2
  18. with:
  19. target: gh-pages
  20. env:
  21. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I have this error :

  1. Jupyter is not available in this Python installation.
  2. 50
  3. Install with python3 -m pip install jupyter
  4. 51
  5. 52
  6. ERROR: Error
  7. 53
  8. at renderFiles (file:///opt/quarto/bin/quarto.js:86658:30)
  9. 54
  10. at async render (file:///opt/quarto/bin/quarto.js:90681:21)
  11. 55
  12. at async renderForPublish (file:///opt/quarto/bin/quarto.js:121247:33)
  13. 56
  14. at async renderForPublish (file:///opt/quarto/bin/quarto.js:109089:24)
  15. 57
  16. at async Object.publish4 [as publish] (file:///opt/quarto/bin/quarto.js:120459:26)
  17. 58
  18. at async publishDocument (file:///opt/quarto/bin/quarto.js:121349:38)
  19. 59
  20. at async publish5 (file:///opt/quarto/bin/quarto.js:121445:132)
  21. 60
  22. at async doPublish (file:///opt/quarto/bin/quarto.js:121401:13)
  23. 61
  24. at async publishAction (file:///opt/quarto/bin/quarto.js:121412:9)
  25. 62
  26. at async Command.fn (file:///opt/quarto/bin/quarto.js:121389:9)
  27. 63
  28. Error: Process completed with exit code 1.

I try to change the file in :

  1. on:
  2. workflow_dispatch:
  3. push:
  4. branches: main
  5. name: Quarto Publish
  6. jobs:
  7. build-deploy:
  8. runs-on: ubuntu-latest
  9. permissions:
  10. contents: write
  11. steps:
  12. - name: Check out repository
  13. uses: actions/checkout@v3
  14. - name: Set up Quarto
  15. uses: quarto-dev/quarto-actions/setup@v2
  16. - name: Install Python and Dependencies
  17. uses: actions/setup-python@v4
  18. with:
  19. python-version: '3.10'
  20. cache: 'pip'
  21. - run: pip install jupyter
  22. - run: pip install -r requirements.txt
  23. - name: Render and Publish
  24. uses: quarto-dev/quarto-actions/publish@v2
  25. with:
  26. target: gh-pages
  27. env:
  28. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

and I have this error :

  1. Error: No file in /home/runner/work/Crowdsourcing/Crowdsourcing matched to [**/requirements.txt or **/pyproject.toml], make sure you have checked out the target repository

I don't have a requirements.txt file and I don't need one so I don't know how I can do to fix it.

答案1

得分: 2

在安装pip requirements.txt之前,您需要检出代码,因此才会出现错误消息。(假设您的远程存储库中有requirements.txt)

使用上述GitHub操作在执行pip install -r requirements.txt之前检出代码库。

如果您不想安装requirements.txt中的依赖项,或者不需要它们,请在工作流程中删除该行(- run: pip install -r requirements.txt)。

英文:

You need to checkout the code before installing pip requirements.txt hence it is throwing the error message.(Assuming you have requirements.txt in your remote repository)

  1. - uses: actions/checkout@v3
  2. with:
  3. fetch-depth: 0

use above github action to checkout the code base before performing pip install -r requirements.txt

If you don't want to install dependencies inside requirements.txt or it is not needed then please remove that line ( - run: pip install -r requirements.txt) in your workflow.

huangapple
  • 本文由 发表于 2023年7月27日 14:59:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76777198.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定