-
Notifications
You must be signed in to change notification settings - Fork 7
52 lines (49 loc) · 1.54 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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