-
Notifications
You must be signed in to change notification settings - Fork 9
57 lines (55 loc) · 1.61 KB
/
scrape.yaml
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
54
55
56
57
name: Scrape Github Orgs
on:
schedule:
- cron: '10 02 * * *'
jobs:
scrape:
name: Run repo scrape
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Run scrape
env:
GITHUB_AUTH_TOKEN: ${{ secrets.REDHAT_PERFBOT_SCRAPE_TOKEN }}
run: |
cd scraper
go mod download
go run main.go
- name: Store repositories.json file
uses: actions/upload-artifact@v3
with:
name: repos
path: public/repositories.json
update:
name: Update gh-pages
runs-on: ubuntu-latest
needs: scrape
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: gh-pages
- name: Delete existing repositories.json file
run: rm -f ./repositories.json
- name: Download repositories.json file
uses: actions/download-artifact@v3
with:
name: repos
path: ./
- name: Update and push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_EMAIL: [email protected]
GH_USERNAME: redhat-perfbot
run: |
git config --global user.name $GH_USERNAME
git config --global user.email $GH_EMAIL
git remote set-url origin https://$GH_USERNAME:[email protected]/redhat-performance/tooling-curator.git
git add repositories.json
git diff-index --quiet HEAD || git commit -am "Periodic repo scrape $(date)"
git push