actions icon indicating copy to clipboard operation
actions copied to clipboard

Deploy via GHA workflow instead of gh-pages branch

Open Bisaloo opened this issue 1 year ago • 1 comments

I understand this needs to be discussed but I figured a PR with some code would be clearer than an issue.

This PR uses GitHub pages new deploy mechanism, as presented in this recent blog post and in GitHub's changelog.

Pros:

  • no extra gh-pages branch
  • no unofficial actions (where JamesIves/github-pages-deploy-action is currently used)
  • use of what is apparently the new recommended way to deploy
  • website is automatically uploaded as an artifact, which opens up options to deal with PR vs push. For example, in this PR, I set it up so artifact is always uploaded but only deployed on pushes. This means that anybody can easily inspect the website without having to render it locally. Additionally, netlify previews will probably be easier to handle. The first job is the same for both PR and pushes and you then have two jobs/deploy paths.

Cons:

  • the website source code is no longer visible on a branch and history is not saved.

Example of the change proposed here in the wild: https://github.com/Bisaloo/fundiversity/blob/main/.github/workflows/pkgdown.yaml

If you like this change, I can implement it in all the other workflows where it would be relevant. I just did pkgdown here as an example.

Bisaloo avatar Aug 13 '22 08:08 Bisaloo

Thanks!

As I see the main issue with this is that a new deployment will wipe out the old one, which is not (easily) compatible with the way we are deploying the dev and the releases versions of pkgdown docs.

So we would still need to keep the website in a branch, at least that's the simplest way to merge the two web sites.

gaborcsardi avatar Sep 22 '22 16:09 gaborcsardi

Since this does not work well with our pkgdown workflow currently, I am going to close it now. Hopefully GH will have a solution for incremental updates in the future.

gaborcsardi avatar Oct 19 '22 11:10 gaborcsardi

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this pull request.

github-actions[bot] avatar Nov 18 '22 02:11 github-actions[bot]