crawl #986
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: crawl | |
on: | |
schedule: | |
- cron: "50 3 * * *" # runs every day at 03:50 UTC to avoid high loads | |
workflow_dispatch: | |
env: | |
HUSKY_SKIP: true | |
GITHUB_TOKEN: ${{secrets.WORKFLOW_CRAWL_GITHUB_TOKEN}} | |
jobs: | |
crawl: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: switch to live-data branch | |
run: | | |
git config --global user.name 'marianfoo' | |
git config --global user.email '[email protected]' | |
git fetch --all | |
git checkout live-data | |
git checkout main | |
- name: get data from live-data | |
run: | | |
git show live-data:data/data.json > data/data.json | |
git show live-data:data/versions.json > data/versions.json | |
git show live-data:data/clones.json > data/clones.json | |
git show live-data:data/contributors.json > data/contributors.json | |
continue-on-error: true | |
- name: Use Node.js LTS (16.x) | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- name: npm install | |
run: | | |
npm install | |
- name: crawl data | |
run: | | |
npm run build | |
- name: Commit/Push build to docs branch | |
run: | | |
git add data/data.json | |
git add data/versions.json | |
git add data/clones.json | |
git add data/contributors.json | |
git commit -m "chore: crawl" | |
git push origin HEAD:live-data -f | |
continue-on-error: true |