spinkube / documentation

Site and Docs for the SpinKube community project
https://www.spinkube.dev/
Apache License 2.0
15 stars 24 forks source link

CI: add preview deployments for PRs #94

Open vdice opened 6 months ago

ThorstenHans commented 5 months ago

I was doing some research on this one.

Although actions/deploy-pages has a preview input (https://github.com/actions/deploy-pages/tree/b580d214b4e13b2a70d0e04376a86ed862ebb558?tab=readme-ov-file#inputs-), it's marked alpha features which is not available to the public.

See https://github.com/actions/deploy-pages/issues/180 and https://github.com/orgs/community/discussions/7730 for further details

vdice commented 5 months ago

I'm noticing some community actions like this one... though have only glanced at it on the surface. Would want to test out if it looked promising.

ThorstenHans commented 5 months ago

Stumbled upon that one as well.

I wasn't sure if that could somehow impact search experience as we index all the things on spinkube.dev maybe we can instruct it to deploy previews to another origin as well and prevent the search engine from indexing that one

vdice commented 5 months ago

I wasn't sure if that could somehow impact search experience as we index all the things on spinkube.dev maybe we can instruct it to deploy previews to another origin as well and prevent the search engine from indexing that one

Oh good point. Based on the examples, it looks like the default preview URLs would be something like spinkube.github.io/documentation/pr-preview/pr-1. Yea, definitely don't want to affect the search indexing...

vdice commented 5 months ago

Oops, reading the fine print:

First, ensure that your repository is configured to have its GitHub Pages site deployed from a branch, by setting the source for the deployment under Settings > Pages of your repository to Deploy from branch:

That won't work for us. Still, perhaps worth a try to experiment on a fork with this action...

vdice commented 3 months ago

Circling back to this. With features/fixes that have landed in Spin and the Cloud plugin, we can utilize Fermyon Cloud to host PR preview deployments for this documentation site (in conjunction with the preview deploy action). Two things we would need: A Fermyon Cloud account and PAT as well as a GitHub PAT for with correct perms for posting a comment on PRs with the preview URL.

Is this something we'd like to add? The main website deployment could remain via GH Pages as it is today. There still doesn't seem to be a solution for GH Pages-based previews that would fit our needs (ref https://github.com/spinkube/documentation/issues/94#issuecomment-2004979822).

bacongobbler commented 2 months ago

I can take a closer look at this.

bacongobbler commented 2 months ago

Quick summary of my learnings (see #187):

My suggested feedback would be to take a look at alternate hosting providers for deploy previews. As @vdice suggested, perhaps we look inwards at Fermyon Cloud? I'd be more than happy to offer up my own account, or perhaps we already have an account for hosting internal infra on there.