Repository navigation
64 lines (54 loc) · 2.09 KB
/
Copy pathbackfill_artists.yml
File metadata and controls
64 lines (54 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Backfill Artists
on:
schedule:
- cron: "0 1 1 * *" # 매달 1일 KST 오전 10:00 실행 (UTC+9 → UTC 01:00) — 최근 35일치만 증분 반영
workflow_dispatch:
inputs:
since_days:
description: "최근 N일 이내 등록된 곡만 대상으로 함 (비워두면 전체 곡 대상 백필)"
required: false
jobs:
run-npm-task:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9
run_install: false
- name: Install dependencies
working-directory: packages/crawling
run: pnpm install
- name: Create .env file
working-directory: packages/crawling
run: |
echo "SUPABASE_URL=${{ secrets.SUPABASE_URL }}" >> .env
echo "SUPABASE_KEY=${{ secrets.SUPABASE_KEY }}" >> .env
# 스케줄 실행은 지난 한 달치만 증분 반영, 수동 실행은 입력값을 그대로 쓴다(비워두면 전체 백필).
- name: Determine backfill window
id: window
run: |
if [ "${{ github.event_name }}" = "schedule" ]; then
echo "since_days=35" >> "$GITHUB_OUTPUT"
else
echo "since_days=${{ inputs.since_days }}" >> "$GITHUB_OUTPUT"
fi
- name: run backfill script - backfillArtists.ts
working-directory: packages/crawling
env:
ARTIST_BACKFILL_SINCE_DAYS: ${{ steps.window.outputs.since_days }}
run: pnpm run backfill-artists
# 로그 파일은 러너 파일시스템에만 남고 잡이 끝나면 사라지므로, 실패해도(if: always()) 확인할 수 있게 올려둔다.
- name: Upload backfill log
if: always()
uses: actions/upload-artifact@v4
with:
name: artist-backfill-log-${{ github.run_id }}
path: packages/crawling/src/assets/artistBackfillLog.txt
if-no-files-found: ignore
retention-days: 30