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

问题描述 投票:0回答:1

我正在尝试在 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 文件,也不需要它,所以我不知道如何修复它。

python github jupyter workflow quarto
1个回答
1
投票

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

- uses: actions/checkout@v3
  with:
    fetch-depth: 0

在执行 pip install -rrequirements.txt 之前使用上面的 github 操作检查代码库

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

© www.soinside.com 2019 - 2024. All rights reserved.