Run schduling jobs for crawling. #290
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run schduling jobs for crawling. | |
on: | |
schedule: | |
- cron: "0 11 * * 1-6" # UTC 기준 월~금 11:00(한국 기준 20:00) | |
push: | |
branches: | |
- main | |
jobs: | |
run-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
# Github Reposiroty의 Secret 가져와서 .env 생성하기 | |
- name: Create .env file | |
run: jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <<< "$SECRETS_CONTEXT" > .env | |
env: | |
SECRETS_CONTEXT: ${{ toJson(secrets) }} | |
- name: Install dependencies | |
run: bun install | |
- name: Run app.ts | |
run: bun run scheduling | |
- name: Commit and push if changed | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "KimCookieYa" | |
git add data/homepage.json | |
git commit -m "Update homepage.json" || exit 0 # 변경사항이 없으면 커밋하지 않음 | |
git push |