-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (36 loc) · 995 Bytes
/
updateJSON.yml
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
name: Auto-update API
on:
schedule:
- cron: '*/5 * * * *'
push:
branches:
- main
jobs:
update-json:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
token: ${{ secrets.TROPITRACKER_API }}
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 23
- name: Install dependencies
run: npm install
- name: Run script to update API
run: npm test
- name: Commit updated JSON files
env:
GH_TOKEN: ${{ secrets.TROPITRACKER_API }}
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git add index.json
git add outlooks.json
git add hurricanes.json
git add tropical-storms.json
git add tropical-depressions.json
git commit -m "Auto-update API"
git push