Open mine-cetinkaya-rundel opened 1 year ago
What kind of trouble were you having? Maybe the GitHub UI changed after we wrote these instructions? I agree this repo could use a documentation overhaul, and we've struggled in the past with how to balance the many different ways in which people use GHA.
One question to clarify something for me: Is quarto publish
command not something desired or not working in this project ?
Our action is way to wrap quarto publish
command line so that project is rendered and deployed to a branch following the repo setting. The idea is to leverage the Github's way to publish thanks to a branch or folder (https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-from-a-branch). We document this approach in this repo.
In static.yml
, this is explicitly using Github action probably following https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow. This is a bit different and would only use quarto-actions/render
as the publish is manually configured and done. We don't document this approach yet (Install quarto, install deps, render project using quarto action, use other external actions to deploy).
Also static.yml
is using a container
and I wonder if our actions are working in this context or not. This could be the blocker you encountered maybe.
Hi, my Git project uses git-crypt and this is making quarto publish gh-pages
to fail with the follow message
git-crypt: Error: Unable to open key file - have you unlocked/initialized this repository yet?
error: external filter '"git-crypt" smudge' failed 1
error: external filter '"git-crypt" smudge' failed
fatal: helm/charts/gesis/files/minesweeper/secrets/herorat.py: smudge filter git-crypt failed
ERROR: Error executing 'git': No such file or directory (os error 2)
Stack trace:
at execProcess (file:///opt/quarto/bin/quarto.js:5273:15)
at withWorktree (file:///opt/quarto/bin/quarto.js:95549:11)
at eventLoopTick (ext:core/01_core.js:181:11)
at async Object.publish4 [as publish] (file:///opt/quarto/bin/quarto.js:95388:5)
at async publishSite (file:///opt/quarto/bin/quarto.js:96063:38)
at async publish5 (file:///opt/quarto/bin/quarto.js:96277:61)
at async doPublish (file:///opt/quarto/bin/quarto.js:96237:13)
at async publishAction (file:///opt/quarto/bin/quarto.js:96248:9)
at async Command.fn (file:///opt/quarto/bin/quarto.js:96225:9)
at async Command.execute (file:///opt/quarto/bin/quarto.js:8105:13)
I believe that use upload-pages-artifact
will resolve the issue.
@rgaiacs Are you able to publish to Github pages usually with git-crypt
? What quarto publish
is doing is running git to check the rendered website to gh-pages
before pushing the pages online. I wonder what would required for this to work for your locally.
I came up with something similar, also based on the same static.yaml template, that seems to work well for me too. Here is a minimal boilerplate:
on:
workflow_dispatch:
push:
branches: [main]
name: Quarto Publish
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
I was having quite a bit of trouble using quarto-publish-example as a basis and following instructions from here when "Source: GitHub Pages [Beta]" is selected on my Pages settings.
Ultimately I was able to get things working with the following, using static.yml as a basis.
I thought it might be helpful to leave this here but also to address the various GitHub pages options in the instructions at https://github.com/quarto-dev/quarto-actions/tree/main/publish#github-pages? I am still not 100% clear on the organization of this repo so I don't have a concrete PR to make but I'm happy to try if this is actually something missing (as opposed to something I missed even though it's addressed).