Finally, I made a move with my blog to start using two repositories in production. One repository holds all the markdown content and assets, and another contains the content of my website.
The reason for this change is that I want to use the content of my blog for testing out other static-site generators and frameworks.
infoHere is an example of how to use it with Astro by symlinking the content and assets
I have been testing it out, and the flow works great. To make my site go live with this new setup, I needed to configure a GitHub Action to build and deploy my site.
What I want to achieve is the following:
GitHub Action Trigger
The first thing I needed to do was add the trigger on my Repository 1 containing the website’s sources.
|
|
Once you add this to the build flow, you can call a webhook on the repository to trigger the build.
Trigger the GitHub Action
On the repository 2 containing my blog’s content, I needed to add a new workflow to trigger the build. When you go to the documentation, it will tell you to use a Personal Access Token (PAT) with the repo
scope.
In my case, I wanted to use the fine-grained personal access token, as it allows more control over the permissions of the token.
To be able to call the webhook, you will need to add a token with the following scopes:
- Read access to metadata (by default enabled)
- Read and Write access to contents
Once you have the token, add it to the secrets of your repository, and configure the following workflow to trigger the build:
|
|