Skip to content

Commit

Permalink
자동화 도전...
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenPearls authored Aug 27, 2024
1 parent 541d4f5 commit 9dbf6a3
Showing 1 changed file with 18 additions and 34 deletions.
52 changes: 18 additions & 34 deletions .github/workflows/Convert and Deploy DevelopLog to Jekyll.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

0 comments on commit 9dbf6a3

Please sign in to comment.