To show your latest dev.to posts in the GitHub page readme is awesome 🌈, because:
- Show you're actively creating blogs ✍️
- Github page's viewers become familiar with your Dev.to blog 🚀
But how to achieve this:
1. The first step is ( Create a username repo )
Make a repository in your GitHub page with your own username - if you haven't created that yet.
like this: https://github.com/vito-mohagheghian/vito-mohagheghian
And will appear in your profile like this.
2. Edit readme.md
File
Copy/Paste the code below, where you wanna your latest blogs appear in the readme.md
file.
they won't appear in preview mode.
## Latest Blog posts
<!-- BLOG-POST-LIST:START -->
<!-- BLOG-POST-LIST:END -->
3. Create a .github
folder
Clone your repository in your device using git clone [your repo's address]
.
like this git clone https://github.com/vito-mohagheghian/vito-mohagheghian.git
Make new a new folder named .github
and inside of this, make a new folder named workflows
, then create a new folder like this: blog-post-workflow.yml
Modify .yml file
Copy/Paste the code below and just replace your dev.to username with mine in feed_list.
name: Latest blog post workflow
on:
schedule:
# Runs every hour
- cron: '0 * * * *'
workflow_dispatch:
jobs:
update-readme-with-blog:
name: Update this repo's README with the latest blog posts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gautamkrishnar/blog-post-workflow@v1
with:
max_post_count: "3"
remove_duplicates: true
feed_list: "https://dev.to/feed/vitomohagheghian"
You can also change max_post_count and remove_duplicates values.
Push Changes to github
push changes you made with the following commands.
git add .
git commit -m "add workflows"
git push
Run Github Actions
Now go to your GitHub repository, and go to the Actions tab.
You will see your workflow below 'all workflows', then click on Run workflow
, and run it.
Congratulation 🎓, You have your own auto Github blog posts updater 🦄.
Keep Coding Y'All 👨🏻💻
Top comments (0)