Auto-update API #481
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: 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 |