How to link and display your latest blog posts to your Github profile
Summary: ↬ In this guide, we'll see an easy way of linking our latest blog posts to our Github profile using a 3rd party package.
Aug 14, 2021
3 min read
Summary: ↬ In this guide, we'll see an easy way of linking our latest blog posts to our Github profile using a 3rd party package.
Aug 14, 2021
3 min read
Hi!
If you're here, I'm guessing you're looking for a way to display your latest blog post articles in your Github profile. But just in case, you don't know what is a Github profile you can check this link where I explain what is a Github profile and how to create one.
Since this is a very simple process (if we take advantage of some existing package, more on this later), let's get to it without wasting any time.
Note: As always with anything related to programming, it is safe to say this is not the only way to display your posts but is one of the simplest.
Although we can do the process manually regarding the Github actions, we're developers, it's safe to say many of us are lazy. So, why reinvent the wheel?
Instead of wasting any time writing everything manually, we'll take advantage of Gautam Krishna package for blog-post-workflow. This will make the process way easier.
https://github.com/<USERNAME>/<USERNAME>
# Blog posts
<!-- BLOG-POST-LIST:START -->
<!-- BLOG-POST-LIST:END -->
Alternatively, you can edit your profile from your text editor by cloning your Github profile repo. This will make the entire process easier.
.github
└───workflows
blog-post-workflow.yml
Make sure the files and folders names are correct.
blog-post-workflow.yml
file:name: Latest blog post workflow
on:
schedule:
# Runs at every 2 days
- cron: '0 0 */2 * *'
workflow_dispatch:
jobs:
update-readme-with-blog:
name: Update this repo's README with latest blog posts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gautamkrishnar/blog-post-workflow@master
with:
feed_list: 'URL_TO_YOUR_RSS_FEED'
Important: Please note that I created my action to run every 2 days. You can set it to run automatically by changing this line with this:
schedule:
- cron: '0 * * * *'
Now, depending on how you configured your Github action schedule, it may or may not run immediately.
To check on your newly created action, go to your Github profile repo. In the actions tab, you should have a new Github action called Latest blog post workflow
(the name depends on the name you added to the config .yml
file.
You can run this action manually by clicking on the Run workflow button.
Once your Github action finishes and assuming everything went well. You should have your latest blog post listed in your Github profile in the area you designated for this at the start of the guide.
They should look like this:
We did it!
Finally don't forget to check on all the options available in the Github package.
Thanks for reading until the end. See you next time!