DEV Community

Cover image for How to display Latest Blogs on Github Profile?
Hemang Yadav
Hemang Yadav

Posted on • Edited on

How to display Latest Blogs on Github Profile?

In this post, we will create a Workflow which updates our GitHub Profile with out latest Blogs on dev.to. To do this, you will need:

  • A GitHub Account
  • A little of passion

LINKS:

1. SET UP README.MD

  • The first step in this process, is to define where we want our blogs. To do that, copy paste the following code in your README.md where you want your blogs:
<!-- BLOG-POST-LIST:START -->
<!-- BLOG-POST-LIST:END -->
Enter fullscreen mode Exit fullscreen mode

NOTE: Your blogs will be showing in the middle of the two comments.

2. WORKFLOW

  • The next step in this process is to create a workflow to update our README.

  • Create a blog-post-workflow.yml file in the .github/workflows/ directory. Ensure your directory has no typo's!

  • We now need to write the workflow in the file which we created. Copy paste the code below into that file:

name: 📚Blogs
on:
  schedule:
    # Runs every hour
    - cron: '0 * * * *'
  workflow_dispatch:

jobs:
  update-readme-with-blog:
    name: ✅Update with latest Blogs
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          max_post_count: "4"
          feed_list: "https://dev.to/feed/YOUR DEV.TO USERNAME HERE"
Enter fullscreen mode Exit fullscreen mode

Remember to add your Dev.to username at the end of the URL on the last line

3. ACTIONS SETTINGS:

  • Head over to the Settings tap located at the top.

Settings Tab

  • Navigate your way to Actions > General Tab from the left.

Actions Settings

  • Ensure that your settings match the settings below

Setting 1

Setting 2

Setting

4. EXECUTING:

  • Finally, we are ready to run our workflow. To do so, first head over to the Actions tab on the top

Actions Tab

  • Select 📚Blogs from the menu on the left.

Blogs Tab

  • Click on the Run workflow dropdown, and click the Run workflow button.

Run Workflow

YOUR README SHOULD NOW HAVE BEEN UPDATED WITH YOUR LATEST BLOGS

SUMMARY:

In this blog, we successfully created and executed a workflow to update our Github Profile's README with our latest blogs on Dev.to. For any kind of support, you can refer to the Links section at the top.

THANKS FOR READING. HOPEFULLY YOU FOUND THIS BLOG HELPFUL!!!

Top comments (0)