From 9dbf6a32814ed46c3c39bdaa824ec73190afba30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CF=85=D0=BCj=CF=85=20lee?= <97003348+GoldenPearls@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:41:40 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=90=EB=8F=99=ED=99=94=20=EB=8F=84?= =?UTF-8?q?=EC=A0=84...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...onvert and Deploy DevelopLog to Jekyll.yml | 52 +++++++------------ 1 file changed, 18 insertions(+), 34 deletions(-) diff --git a/.github/workflows/Convert and Deploy DevelopLog to Jekyll.yml b/.github/workflows/Convert and Deploy DevelopLog to Jekyll.yml index ab9fd64..c6d7f0e 100644 --- a/.github/workflows/Convert and Deploy DevelopLog to Jekyll.yml +++ b/.github/workflows/Convert and Deploy DevelopLog to Jekyll.yml @@ -1,32 +1,20 @@ -name: Convert and Deploy DevelopLog to Jekyll - +name: Update Blog Posts + on: push: branches: - - main + - main # 또는 워크플로우를 트리거하고 싶은 브랜치 이름 + schedule: + - cron: '40 10 * * *' # 매일 오전 10시 40분에 실행 jobs: - build: + update_blog: runs-on: ubuntu-latest steps: - - name: Checkout Repository + - name: Checkout uses: actions/checkout@v2 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.0' # Ruby 3.0.0 이상으로 업데이트 - - - name: Update RubyGems - run: gem update --system # RubyGems 업데이트 - - - name: Install dependencies - run: | - gem install bundler # Bundler 설치 - gem install ffi # ffi 최신 버전 설치 - bundle install # 필요한 gems 설치 - - name: Convert Markdown to Jekyll Format run: | mkdir -p _posts @@ -59,21 +47,17 @@ jobs: git commit -m "Add post: $title" done - - name: Checkout GitHub Pages Repository - uses: actions/checkout@v2 - with: - repository: YourGitHubPagesRepoOwner/YourGitHubPagesRepoName - path: gh-pages - - - name: Copy Converted Files to GitHub Pages Repo + - name: Push changes run: | - cp _posts/* gh-pages/_posts/ + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git push https://${{ secrets.GH_PAT }}@github.com/GoldenPearls/velog.git # 자신의 깃허브명으로 바꿔야 함 - - name: Commit and Push Changes + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies run: | - cd gh-pages - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - git add . - git commit -m "Bulk commit of converted posts" - git push https://${{ secrets.GH_PAT }}@github.com/GoldenPearls/GoldenPearls.github.io.git + pip install feedparser gitpython