-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.75 KB
/
collect-realtime.yml
File metadata and controls
58 lines (48 loc) · 1.75 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
name: Collect Realtime Facility Status
on:
schedule:
- cron: '0 2,5,8,11,14,20,23 * * *' # Every 1.5 hours during Seoul Metro operating hours (05:00~00:59 KST, UTC+9)
- cron: '30 0,3,6,9,12,15,21 * * *' # Half-hour slots for 90-minute interval
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
collect:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: scripts/package.json
- name: Install dependencies
run: npm install
working-directory: scripts
- name: Collect all realtime facilities
env:
SEOUL_API_KEY: ${{ secrets.SEOUL_API_KEY }}
run: node collect.js --all-realtime
working-directory: scripts
- name: Build latest.json
run: node build-latest.js
working-directory: scripts
- name: Create pull request with data
id: cpr
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7
with:
commit-message: 'chore: collect realtime data'
branch: auto/collect-realtime
title: 'chore: collect realtime data'
body: 'Automated realtime facility data collection.'
add-paths: |
data/**
web/public/data/**
- name: Enable auto-merge
if: steps.cpr.outputs.pull-request-number
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
run: gh pr merge "$PR_NUMBER" --auto --squash