Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine with actions/deploy-pages #21

Open
astrojuanlu opened this issue Oct 9, 2022 · 4 comments
Open

Combine with actions/deploy-pages #21

astrojuanlu opened this issue Oct 9, 2022 · 4 comments
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@astrojuanlu
Copy link

This workflow seems to target the "classic" GitHub Pages experience. However, nowadays there's also the newer workflow using https://github.com/marketplace/actions/deploy-github-pages-site

image

I'm trying to combine the two actions but so far I've been unsuccessful: either nothing happens, or I'm getting errors coming from actions/deploy-pages saying Branch "..." is not allowed to deploy to github-pages due to environment protection rules.

Do you have an example on how to use rossjrw/pr-preview-action with the new workflow?

@rossjrw
Copy link
Owner

rossjrw commented Oct 11, 2022

I'm afraid I don't currently have any examples - the above workflow is new to me! I'll make sure to assess whether the two can be reconciled at some point in the future - thanks for bringing it up.

@rossjrw rossjrw added the documentation Improvements or additions to documentation label Oct 11, 2022
@vincerubinetti
Copy link

I wonder if the new "Pages from Actions" option would even support something like this? Also, if people haven't seen this yet, GitHub is supposedly working on integrating this feature directly into GitHub. It'd be nice to not have to link Netlify to repos anymore!

@MattF-NSIDC
Copy link

MattF-NSIDC commented Jul 7, 2023

I wonder if the new "Pages from Actions" option would even support something like this?

I think it's much harder with the "Pages from Actions" workflow, and requires sacrificing atomicity. With "Pages from branch", you can add a subdirectory easily to the gh-pages branch. With "Pages from Actions", all deployments are atomic, like Netlify deploys, which is great. Until you want to do something like add a directory to a deployed site. That might look like:

  • Download the currently-deployed site (how?);
  • add a subdirectory to the local copy;
  • push that new directory structure as a pages artifact;
  • actions/deploy-pages.

But now when your next atomic production deploy comes through, the preview is overwritten! Not as simple as I first thought to work around this. So I went with Netlify.

I'm hoping the feature GitHub is working on enables both atomic preview deploys (like Netlify) and atomic production deploys that can't step on each-others' toes, e.g. previews deploy to preview-pr-N.mysite.github.io or something 🤷

@rossjrw
Copy link
Owner

rossjrw commented Nov 23, 2023

Noting that I've looked into this a little further, detailing some thoughts here: https://github.com/orgs/community/discussions/30113#discussioncomment-7650234

I'm not sure that the artifact-based deployment method has the versatility to support this action. @MattF-NSIDC raises some excellent points and I think I would have come to the same conclusions.

Looking at the 'preview' parameter of actions/deploy-pages that MattF linked, it looks like that parameter gets sent to the /repos/{owner}/{repo}/pages/deployments octokit endpoint as part of the payload. Octokit docs state 'The payload parameter is available for any extra information that a deployment system might need'... so I actually have no idea where that parameter ends up being used or what it does.

It sounds like the actions/deploy-pages maintainers don't have a timeline for it either (actions/deploy-pages#180) so I'm not particularly hopeful. If it does end up working how MattF hypothesises I'll probably jump ship to it straight away, but I'm not going to dwell on it in the meantime.

But now when your next atomic production deploy comes through, the preview is overwritten! Not as simple as I first thought to work around this.

Ironically the ideal solution to this IMO would be something Git-based... maybe the deployment artifact could be a Git repository? Maybe streamline that to be a branch of the current repository? What if you could deploy Pages directly from a branch? 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants