PreTeXtBook / pretext-cli

Command line interface for quickly creating, authoring, and building PreTeXt documents.
https://pretextbook.org
GNU General Public License v3.0
17 stars 17 forks source link

Make two deploy methods cohesive #725

Open oscarlevin opened 4 months ago

oscarlevin commented 4 months ago

If you use pretext deploy, you deploy to the gh-pages branch. But if you use the github actions workflow, you need to have your pages setting set to actions. It would be nice to have both options available for a single project.

StevenClontz commented 3 months ago

See also https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#:~:text=All%20GitHub%20Pages%20builds%20will%20use%20GitHub%20Actions%20from%20June%2030%2C%202024.

oscarlevin commented 2 months ago

See also https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#:~:text=All%20GitHub%20Pages%20builds%20will%20use%20GitHub%20Actions%20from%20June%2030%2C%202024.

I think that warning is that you need github actions enabled for the repository, not that github actions needs to be the method for deploying pages. Elsewhere in the documentation it talks about how even if you use a different CI workflow to build the site, and say push it to a gh-pages branch, the final deployment will be done with an action. It's just not an action you need to set up.

So, I wonder if it makes sense to just run pretext deploy in our action. That way everything is always the same.

StevenClontz commented 2 months ago

I think https://github.com/braughtg/ex-link-pretext-bug/actions/runs/9487487141/job/26144337095#:~:text=consider%20exploring%20the%20%60enablement%60%20parameter%20for%20this%20action is a clue on how to enable GH Pages via Actions.

I'm hopeful next week we'll find a solution that allows for deployments (whether from local or from CI/CD) that don't muck up a gh-pages branch and bloat the repo.

StevenClontz commented 2 months ago

I'm also interested in adding support for Cloudflare Pages, where every push to a repository could be built and deployed to a preview URL, with merges to main going to the canonical URL. https://developers.cloudflare.com/pages/configuration/preview-deployments/

StevenClontz commented 2 months ago

I'm somewhat leaning towards wontfix here - keep pretext deploy as a legacy feature for the rest of 2.x, but encourage folks to use action deploys instead (or manually deploy), to increase likelihood of valid/buildable projects, and improve visibility/troubleshooting for when things don't work

If we do update this, I wonder if, rather than having an action create an artifact, we can have pretext deploy upload an artifact from the local machine, so we can reuse both the ghpages and cloudflare (and future) workflows to handle the rest.