discord-jda / JDA-Website

Source for the JDA Wiki Website
https://jda.wiki
Apache License 2.0
11 stars 19 forks source link

Create GitHub Action for deploy previews #30

Closed Andre601 closed 2 years ago

Andre601 commented 2 years ago

Adds a Workflow that automatically builds previews of Pull requests using a dedicated Account (@gh-pages-deploy) I made a while ago for this exact purpose.

This has been discussed in splash page, take 2 with DV8 and he showed a general interest in this.

This PR also adds a requirements.txt as the action uses it to more easily obtain the required software such as Material for MkDocs.

Closes #18

How it works

The action does the following things:

This process is repeated whenever an update is pushed to a PR. The comment will be edited in this case.

Example result: https://github.com/Andre601/blog/pull/79#issuecomment-1174106662

Why this setup?

I'm well aware that services such as netlify or Vercel exist. But they will often require you to add extra bots to your repository, and in the case of netlify also need a lot of configuration to get rid of useless stuff (Status checks).

Not to mention are they not just for previews, but also always build production versions of the site, which is useless. Finally, are they often also limited to X amount of build minutes. Those limits are often quite generous, but still.

This setup allows you to use GitHub Pages to have previews (and only previews) for Pull requests without the need to add external bots or grant external sites access to your account. It comes at the cost of a more complicated setup tho with the requirement of a PAT.

Hopefully, GitHub will soon add PR deploy previews to their services... (They mentioned such a thing to be planned).

Missing required steps