-
Notifications
You must be signed in to change notification settings - Fork 19
53 lines (43 loc) · 1.22 KB
/
publish-snapshot.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
53
name: 'Publish: snapshot/v1'
on:
schedule:
- cron: 0 */2 * * *
push:
branches: [ master ]
jobs:
publish-snapshot:
runs-on: ubuntu-18.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.7.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
ref: master
token: ${{ secrets.BOT_GITHUB_TOKEN }}
- uses: actions/setup-node@master
with:
node-version: 14.x
- name: Install NPM dependencies
run: |
cd crawler
npm install
- name: Configure git
run: |
git config user.email "github-bot@brigade.cloud"
git config user.name "Brigade Bot"
git fetch origin refs/heads/snapshot/v1:refs/heads/snapshot/v1 refs/heads/cfapi/orgs/v1:refs/heads/cfapi/orgs/v1
- name: Crawl projects
env:
GITHUB_ACTOR: brigade-bot
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
run: |
node crawler/run.js \
--all \
--commit-to=snapshot/v1 \
--commit-orgs-to=cfapi/orgs/v1
- name: Push results
if: ${{ always() }}
run: |
git push origin refs/heads/snapshot/v1 refs/heads/cfapi/orgs/v1