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

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

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

问题

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

on:
  workflow_dispatch:
  push:
    branches: main

name: Quarto Publish

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Check out repository
        uses: actions/checkout@v3

      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2

      - name: Render and Publish
        uses: quarto-dev/quarto-actions/publish@v2
        with:
          target: gh-pages
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

我遇到了以下错误:

Jupyter is not available in this Python installation.
50
Install with python3 -m pip install jupyter
51

52
ERROR: Error
53
    at renderFiles (file:///opt/quarto/bin/quarto.js:86658:30)
54
    at async render (file:///opt/quarto/bin/quarto.js:90681:21)
55
    at async renderForPublish (file:///opt/quarto/bin/quarto.js:121247:33)
56
    at async renderForPublish (file:///opt/quarto/bin/quarto.js:109089:24)
57
    at async Object.publish4 [as publish] (file:///opt/quarto/bin/quarto.js:120459:26)
58
    at async publishDocument (file:///opt/quarto/bin/quarto.js:121349:38)
59
    at async publish5 (file:///opt/quarto/bin/quarto.js:121445:132)
60
    at async doPublish (file:///opt/quarto/bin/quarto.js:121401:13)
61
    at async publishAction (file:///opt/quarto/bin/quarto.js:121412:9)
62
    at async Command.fn (file:///opt/quarto/bin/quarto.js:121389:9)
63
Error: Process completed with exit code 1.

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

on:
  workflow_dispatch:
  push:
    branches: main

name: Quarto Publish

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Check out repository
        uses: actions/checkout@v3

      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2

      - name: Install Python and Dependencies
        uses: actions/setup-python@v4
        with:
          python-version: '3.10'
          cache: 'pip'
      - run: pip install jupyter
      - run: pip install -r requirements.txt

      - name: Render and Publish
        uses: quarto-dev/quarto-actions/publish@v2
        with:
          target: gh-pages
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

我遇到了以下错误:

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 :

on:
 workflow_dispatch:
 push:
    branches: main

name: Quarto Publish

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Check out repository
        uses: actions/checkout@v3

      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2

      - name: Render and Publish
        uses: quarto-dev/quarto-actions/publish@v2
        with:
          target: gh-pages
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I have this error :

Jupyter is not available in this Python installation.
50
Install with python3 -m pip install jupyter
51

52
ERROR: Error
53
    at renderFiles (file:///opt/quarto/bin/quarto.js:86658:30)
54
    at async render (file:///opt/quarto/bin/quarto.js:90681:21)
55
    at async renderForPublish (file:///opt/quarto/bin/quarto.js:121247:33)
56
    at async renderForPublish (file:///opt/quarto/bin/quarto.js:109089:24)
57
    at async Object.publish4 [as publish] (file:///opt/quarto/bin/quarto.js:120459:26)
58
    at async publishDocument (file:///opt/quarto/bin/quarto.js:121349:38)
59
    at async publish5 (file:///opt/quarto/bin/quarto.js:121445:132)
60
    at async doPublish (file:///opt/quarto/bin/quarto.js:121401:13)
61
    at async publishAction (file:///opt/quarto/bin/quarto.js:121412:9)
62
    at async Command.fn (file:///opt/quarto/bin/quarto.js:121389:9)
63
Error: Process completed with exit code 1.

I try to change the file in :

on:
 workflow_dispatch:
 push:
    branches: main

name: Quarto Publish

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Check out repository
        uses: actions/checkout@v3

      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2

      - name: Install Python and Dependencies
        uses: actions/setup-python@v4
        with:
          python-version: '3.10'
          cache: 'pip'
      - run: pip install jupyter
      - run: pip install -r requirements.txt

      - name: Render and Publish
        uses: quarto-dev/quarto-actions/publish@v2
        with:
          target: gh-pages
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

and I have this error :

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)

- uses: actions/checkout@v3
  with:
    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:

确定