Skip to content

Fetch and Save Data #24

Fetch and Save Data

Fetch and Save Data #24

Workflow file for this run

name: Fetch and Save Data
on:
schedule:
- cron: '0 8 * * 1-5' # Every weekday at 8am
push:
branches:
- master
workflow_dispatch:
jobs:
fetch_data:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '19'
- name: Install dependencies
run: npm install
- name: Fetch and save data
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
run: node fetchAndSaveData.js
- name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add data.json
git commit -m "Update data.json [skip ci]" || exit 0
git push