본문 바로가기

Development/Tip

[Tip] Github README에 내가 작성한 블로그 최신 글 가져오기

나의 Github README에 블로그 최근 글 작성하기

적용샷

 

1. 자신을 소개하는 README.md에 블로그 글 목록이 들어갈 자리에 다음 코드 넣기

<!-- BLOG-POST-LIST:START -->
<!-- BLOG-POST-LIST:END -->

 

2. README.md가 위치하는 Repository에 .github 폴더를 만들고, 그 안에다가 또 workflows 라는 폴더 만들기

 

3. blog-post-workflow.yml 라는 파일에 아래 코드 붙여넣기

name: Latest blog post workflow
on:
  schedule: # Run workflow automatically
    - cron: '0 * * * *' # Runs every hour, on the hour
  workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the GitHub Actions Workflow page directly
permissions:
  contents: write # To write the generated contents to the readme

jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Pull in dev.to posts
        uses: gautamkrishnar/blog-post-workflow@v1
        with:
          feed_list: "https://dev.to/feed/gautamkrishnar,https://www.gautamkrishnar.com/feed/"

 

4. 맨 아래  feed_list: 에 본인의 블로그 rss 주소 넣기. 티스토리의 경우, 본인의 블로그 맨 끝에 /rss를 붙이면 됩니다.
예를 들어, https://bezzang2.tistory.com/rss

 

단, 티스토리에 블로그 설정>관리>블로그 에 Rss 설정을 적절히 해주셔야 합니다.

 

5. Actions 탭에,  Latest blog post workflow에 들어가서 Re-run all jobs(또는 Run workflow) 클릭해서 새로고침 하면 끝

처음에만 새로고침해도 되고, 어차피 cron에 의해서 매 시간마다 새로고침이 됩니다.

 

자세한 내용은 공식 홈페이지 URL에서 확인하실 수 있습니다.

https://github.com/marketplace/actions/blog-post-workflow

 

Blog Post Workflow - GitHub Marketplace

Allows you to show your latest blog posts on your github profile or project readme

github.com