getpelican / pelican-themes

Themes for Pelican
https://getpelican.com/
2.12k stars 1.09k forks source link

Add preview site build script and GitHub Actions workflow #748

Closed avaris closed 1 year ago

avaris commented 1 year ago

Added a script for generating theme previews and a actions workflow for publishing the generated preview site under github pages for this repo. I have configured the repo settings. Once this is merged and workflow runs, it should be available under https://getpelican.github.io/pelican-themes . Workflow is configured for pushes on master or manual runs (if necessary).

Example site is currently available at my fork: https://avaris.github.io/pelican-themes/

Heavily based on the work by @maphew, thanks!

Fixes #731, Fixes #740 (kind of... redirection for pelicanthemes.com will be required)

justinmayer commented 1 year ago

@avaris: If we were to use the pelicanthemes.com domain instead of getpelican.github.io, what do you think would be the best way to handle that? I have a web server we can use for that purpose — we would just need to use rsync or something similar to transfer the generated files. Perhaps something like what is described in the following article would do the trick? What do you think?

Deploying to a server via SSH and Rsync in a Github Action

jaideep2 commented 1 year ago

@justinmayer we could also connect pelicanthemes.com to the static output of the action workflow and serve it via github pages https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site

justinmayer commented 1 year ago

I forgot that GitHub Pages can be used with custom domains. That is indeed an alternative to using Rsync and our own web server, although it would sacrifice some flexibility (e.g., adding re-directs for old URLs to current URLs, etc.).

avaris commented 1 year ago

I imagined serving will be done on github.io and pelicanthemes.com could simply redirect to it for simplicity. If you prefer a custom server, yes, rsync after generation would likely do the trick.

justinmayer commented 1 year ago

Via fa82822 I added a block to the CI workflow that (should) also transmit the generated preview site assets to the server hosting the pelicanthemes.com domain. This way we can experiment with both options and decide which one works best.

justinmayer commented 1 year ago

Let's merge this and see what happens. Many thanks to @maphew and @avaris for working on this!

justinmayer commented 1 year ago

It appears that this endeavor was successful, with the contents visible on both domains listed above. 🎊

Now to decide which domain to keep and which to retire. 😉