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

Idea: Deploy chord-editor from CI to GitHub pages with custom domain. #7

Open
jgarte opened this issue Oct 10, 2022 · 15 comments
Open

Comments

@jgarte
Copy link
Contributor

jgarte commented Oct 10, 2022

@newlandsvalley

The idea would be to have the app rebuilt and deployed to GitHub Pages on every commit to master via the CI pipeline.

You can use your current domain of tradtunedb.org.uk and the SSL would probably be handled automatically for you so that you have https configured without having to worry about setting it up yourself or renewing with the certificate authority.

I currently have this set up on SourceHut for this website: https://whereis.みんな/

This is the deploy script for that website: https://git.sr.ht/~whereiseveryone/website/tree/master/item/.build.yml

What do you think?

@jgarte jgarte changed the title IDEA: Deploy app from CI to GitHub pages with custom domain. Idea: Deploy app from CI to GitHub pages with custom domain. Oct 10, 2022
@jgarte jgarte changed the title Idea: Deploy app from CI to GitHub pages with custom domain. Idea: Deploy chord-editor from CI to GitHub pages with custom domain. Oct 10, 2022
@newlandsvalley
Copy link
Owner

Oh, I'd no idea that this was available, SSL configuration has been a bit of a nightmare for me so far. Is this something you could help with?

@jgarte
Copy link
Contributor Author

jgarte commented Oct 10, 2022

Oh, I'd no idea that this was available, SSL configuration has been a bit of a nightmare for me so far. Is this something you could help with?

Sure, I can research how we would do that with a GitHub Action. I can't promise any soonish ETAs on a PR for it because I haven't fully scoped out how to do it but we can openly discuss it here and see what we discover. I'll start asking around, reading docs, and looking at other repositories that are doing something similar in my free time.

@newlandsvalley
Copy link
Owner

That's really nice of you. There's absolutely no rush for this, of course,

@jgarte
Copy link
Contributor Author

jgarte commented Oct 10, 2022

That's really nice of you. There's absolutely no rush for this, of course,

I'm curious to find out how to do this also ;()

@jgarte
Copy link
Contributor Author

jgarte commented Oct 10, 2022

@newlandsvalley

I think what you might need is something like this action added to your ci.yml:

- name: Deploy
  uses: peaceiris/actions-gh-pages@v3
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: ./public

I haven't researched yet how the secrets.GITHUB_TOKEN works in the above example.

MonoidMusician is using something like that here for their blog that uses PureScript and deku: MonoidMusician/blog@ae5fde9#diff-28802fbf11c83a2eee09623fb192785e7ca92a3f40602a517c011b947a1822d3R34

mikesol had contributed the deploy configs in this commit: MonoidMusician/blog@ae5fde9

@jgarte
Copy link
Contributor Author

jgarte commented Oct 10, 2022

@newlandsvalley

Here's another example .yml that Thomas Honeyman recommended over Discord just now in # general:

https://github.com/thomashoneyman/purescript-halogen-formless/blob/main/.github/workflows/storybook.yml#L21

Here's the live app/website that it deploys to GitHub Pages:

https://thomashoneyman.github.io/purescript-halogen-formless/

Thomas is not using a custom domain but you can according to this doc:

https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site

@jgarte
Copy link
Contributor Author

jgarte commented Oct 25, 2022

@newlandsvalley
Copy link
Owner

Many thanks for putting so much effort into finding out how to do this. I'd be happy for you to give this a shot if you feel like it,

@jgarte
Copy link
Contributor Author

jgarte commented Oct 25, 2022

What I'll do next: I'll try to deploy chord-editor on my own GitHub Pages account for testing and then once I determine what works I can share the yml file I used for it in a PR.

I imagine that you will need to point an A record or CNAME to GitHub's Pages IP address unless you want to use their generic subdomain that they give out for free.

@newlandsvalley
Copy link
Owner

Thanks for offering this, @jgarte. A records and CNAMEs are not something I know anything about - presumably they allow my domain name to point to another server in addition to my own server. I've just seen that my domain name supplier does allow me to set them up. I need to learn about this.

@jgarte
Copy link
Contributor Author

jgarte commented Oct 25, 2022

I've just seen that my domain name supplier does allow me to set them up.

This is all you need to know pretty much.

You'll probably just need to login to your domain name supplier and set up either an A record or CNAME. GitHub Pages probably has a tutorial guide that will walk you through the process.

Actually, I think you will need a CNAME if you want to point it to a subdomain like https://chords.tradtunedb.org.uk or whatever you'd like to name it.

@newlandsvalley
Copy link
Owner

That's very helpful. Giving me a hint as to a (virtual) host name I might use makes things a bit clearer. So, this is a subdomain - I'm getting there gradually!

@jgarte
Copy link
Contributor Author

jgarte commented Oct 28, 2022

@newlandsvalley What do you think if we break this one up into two phases.

First, we test deploying using your free domain that GitHub Pages gives you.

I think that will be easier/less things to worry about.

The default domain will be https://newlandsvalley.github.io/purescript-chord-editor/

Then once we are able to do that we can figure out how to use your custom domain.

What do you think?

@newlandsvalley
Copy link
Owner

I think that is an excellent idea!

@jgarte
Copy link
Contributor Author

jgarte commented Oct 28, 2022

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

No branches or pull requests

2 participants