Fetch Data Every Month #213
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: Fetch Data Every Month | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
schedule: | |
# * is a special character in YAML so you have to quote the following string | |
# '37 5 1 * *' represents 5:37am (the time is arbitrary) on the 1st day of every month | |
- cron: '37 5 1 * *' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "fetchdata" | |
fetchdata: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Cache node_modules | |
uses: actions/[email protected] | |
with: | |
# A list of files, directories, and wildcard patterns to cache and restore | |
path: node_modules | |
# An explicit key for restoring and saving the cache | |
key: node-modules-${{ hashFiles('package-lock.json') }} | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0 | |
node-version: ">=10.15.0" # TODO: fix | |
- name: Install Dependencies | |
if: steps.node-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Fetch Data | |
run: npx ts-node getcoursedata.ts -y | |
- name: Commit & Push Changes | |
uses: EndBug/[email protected] | |
with: | |
add: 'data' | |
default_author: github_actions | |
message: 'Update data' | |
pull_strategy: NO-PULL | |