quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.76k stars 306 forks source link

_publish.yml file missing after running quarto publish #6814

Closed lmweber closed 1 year ago

lmweber commented 1 year ago

Bug description

The documentation notes that:

The _publish.yml file is used to to specify the publishing destination. This file is automatically 
created (or updated) whenever you execute the quarto publish command, and is located within the 
project or document directory.

However when I run quarto publish gh-pages in my repo, this does not appear to create this file. I have searched through the repo and tried deleting and re-building various parts of the repo (e.g. removing the gh-pages branch and re-running everything), but can't find the file anywhere. I have also tried running a basic tutorial to create a Quarto project and publish to GitHub Pages, which works correctly, but the _publish.yml file is never created. Publishing manually with quarto publish works fine, but publishing with GitHub Actions does not work since the _publish.yml file is missing.

Is it possible to create the _publish.yml file manually if it is missing? In this case, where should it be saved, and what should be used for the values of the entries (source, id, url)?

I have found the following template on the documentation page, so if it is possible to update this and save it in the correct location, maybe this will work.

- source: project
  quarto-pub:
    - id: "5f3abafe-68f9-4c1d-835b-9d668b892001"
      url: "https://njones.quarto.pub/blog"

Right now I aim getting the following error from GitHub Actions:

ERROR: No _publish.yml file available (_publish.yml specifying a destination required for non-interactive publish)

Steps to reproduce

No response

Expected behavior

No response

Actual behavior

No response

Your environment

Quarto check output

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.450
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.12 (Conda)
      Path: /Users/lukas/miniconda3/bin/python
      Jupyter: 4.9.2
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.3.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library
      knitr: 1.43
      rmarkdown: 2.24

[✓] Checking Knitr engine render......OK
mcanouil commented 1 year ago

Thanks for the report!

Closing as a duplicate of:

lmweber commented 1 year ago

Thanks. I found that other issue when I was searching for a solution, but I don't think this answers the question for my issue.

I understand the difference between the _publish.yml and publish.yml (or in my case quarto-publish.yml) files.

My issue is that the _publish.yml file is never created when running quarto publish. Without the _publish.yml file, GitHub Actions cannot publish the website. If anyone else has any ideas about how to create this file please let me know.

mcanouil commented 1 year ago

See https://github.com/quarto-dev/quarto-cli/issues/5686#issuecomment-1563361415, especially the screenshot from the documentation highlighting the need to run the command locally first.

lmweber commented 1 year ago

Awesome, thank you! This seems to be working now (at least in a new test repo I set up just now).

I thought I tried exactly this (running quarto publish gh-pages locally first) and it did not work previously, but now it seems to be fine.

Maybe it was due to my existing gh-pages branch getting in the way previously.

I have now run the following steps, which has worked:

The _publish.yml file that I was referring to above and is mentioned in the documentation is never created or needed.

mcanouil commented 1 year ago

Again regarding _publish.yml, this is reported and highlighted in my comment on the other issue.