collect fiddles #3637
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
# Collect all examples into a JSON file | |
name: collect fiddles | |
on: | |
# allow running the scraper manually | |
workflow_dispatch: | |
# and several times a day | |
schedule: | |
- cron: '0 0,4,8,12,16,20 * * *' | |
jobs: | |
collect: | |
runs-on: ubuntu-20.04 | |
env: | |
# we do not need to install Cypress to run this test | |
CYPRESS_INSTALL_BINARY: 0 | |
steps: | |
# we need our scraping config, thus check out code | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
with: | |
# check out all commits to get accurate created date | |
fetch-depth: 0 | |
- name: Install dependencies 📦 | |
uses: bahmutov/npm-install@v1 | |
- name: Collect examples | |
run: npm run export:examples | |
- name: Commit changed JSON file 💾 | |
# https://github.com/stefanzweifel/git-auto-commit-action | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Updated fiddles.json | |
branch: master | |
file_pattern: fiddles.json |