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

Fixes #23 Deploy site for each git branch #170

Open
wants to merge 2 commits into
base: hakyll
Choose a base branch
from

Conversation

visortelle
Copy link

@visortelle visortelle commented Dec 29, 2021

Hello.

I implemented per-branch deployment for the site.

Demo

Deployments List

If you'll make your own experiments with the PR, be patient with GitHub pages. Update sometimes took up to 5 minutes.

How it works

The hakyll branch will be available at <domain_name>/.
Other branches are available at <domain_name>/branches/<branch_name>.

It doesn't support automated PRs build. I described manual steps for PR creators on how to create a demo deployment here: https://github.com/visortelle/haskellfoundation.github.io#prs-deployment

Alternative

The approach with GitHub pages implemented here is the simplest way to achieve the goal that comes to my mind. An alternative approach would require extra infra resources like VM access or S3 bucket, plus automation to dynamically create and remove DNS records.

Or much simpler - switch from gh-pages to Vercel or similar hosting that supports feature branch deployments out of the box. Unfortunately, Vercel doesn't support Haskell out of the box, therefore it’s not an option if usage Hakyll is a matter of principle.

If the PR is OK for you.

There are simple extra actions you should do.

  • At first, you should configure the GitHub pages to use the /docs directory.

Screen Shot 2021-12-29 at 10 28 32 PM

I hope that's it.

@visortelle
Copy link
Author

visortelle commented Dec 29, 2021

Probably found a bug. Will notify you after the fix.

@visortelle
Copy link
Author

visortelle commented Dec 30, 2021

Now it should work.
Was confused with the hardcoded branch name here:

@visortelle
Copy link
Author

visortelle commented Dec 30, 2021

Implemented deployment deletion after branch deletion.

@visortelle
Copy link
Author

visortelle commented Dec 30, 2021

For development branches added a meta tag to block search bots indexing. https://developers.google.com/search/docs/advanced/crawling/block-indexing

Done by monkey-patching html files after each build: replace <head> to <head><meta name="robots" content="noindex, nofollow">.

@visortelle visortelle changed the title #23 Deploy site for each git branch Fix #23 Deploy site for each git branch Dec 30, 2021
@visortelle visortelle changed the title Fix #23 Deploy site for each git branch Fixes #23 Deploy site for each git branch Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant