schedule #709
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: schedule | |
on: | |
schedule: | |
# KST 00:00 에 날짜 바뀔떄는 은행 점검 중이라서 제대로 작동하지 않는다. | |
# 적당히 다음날 아침에 보면 새로운 금리가 반영되어있는걸 원한다 | |
# https://support.toss.im/faq/129?from=5&page=1 은행 점검시간 적당히 피해서 설정 | |
# UTC 16:00 = KST 01:00 | |
# https://crontab.guru/ | |
- cron: '0 16 * * *' | |
# - cron: '*/10 * * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- uses: actions/setup-node@v3 | |
with: | |
# 특별히 손본게 없는데 18.19.0 부터 github actions에서 터지길래 버전 고정 | |
node-version: 18.18.2 | |
- uses: pnpm/action-setup@v2 | |
id: pnpm-install | |
with: | |
version: 8.11.0 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: git config | |
run: | | |
git config --local user.name '${{github.actor}}' | |
git config --local user.email 'github-action-${{github.actor}}@users.noreply.github.com' | |
- name: check | |
working-directory: packages/cli | |
run: pnpm build | |
- name: worker | |
working-directory: packages/cli | |
run: | | |
pnpm cli -- region:fetch | |
pnpm cli -- region:parse | |
pnpm cli -- rate:fetch | |
pnpm cli -- rate:parse | |
pnpm cli -- report:write | |
- name: preapre | |
run: | | |
bash ./scripts/prepare_snapshot.sh | |
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files | |
- name: date | |
run: | | |
export TZ="Etc/GMT-9" | |
current_datetime=$(date --rfc-email) | |
echo "current_datetime=${current_datetime}" >> $GITHUB_ENV | |
# https://github.com/peaceiris/actions-gh-pages | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
# If you're changing the branch from main, | |
# also change the `main` in `refs/heads/main` | |
# below accordingly. | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
commit_message: 'deploy: ${{ env.current_datetime }}' | |
publish_branch: interest-rate | |
publish_dir: ./output |