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.
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
[x] Adding the account's PAT as Secret with name BOT to the Repository. DV8 already has said PAT and will add it once he has time.
[x] (Probably) grant write access for the Account? I'm not to sure about what privileges the account needs to pull changes, build them and push them to an external repository.
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:
mkdocs build
gh-pages
branch under a dedicated directory (In this caseDV8FromTheWorld/JDA-Website/<pr.number>
)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
BOT
to the Repository. DV8 already has said PAT and will add it once he has time.