-
-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (50 loc) · 1.78 KB
/
crawl.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
54
55
56
57
name: Crawl
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * 5"
jobs:
crawl:
runs-on: ubuntu-latest
steps:
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Install packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::httr
any::jsonlite
- name: Check out repository
uses: actions/checkout@v4
with:
path: main_folder
ref: main
- name: Create and populate credentials file with secrets
working-directory: ./main_folder
run: |
echo 'scopus_apikey="'"$MAPPED_SCOPUS_APIKEY"'"' >> credentials.R
echo 'scopus_insttoken="'"$MAPPED_SCOPUS_INSTTOKEN"'"' >> credentials.R
echo 'openai_apikey="'"$MAPPED_OPENAI_APIKEY"'"' >> credentials.R
echo 'crossref_email="'"$MAPPED_CROSSREF_EMAIL"'"' >> credentials.R
shell: bash
env:
MAPPED_SCOPUS_APIKEY: ${{ secrets.SCOPUS_APIKEY }}
MAPPED_SCOPUS_INSTTOKEN : ${{ secrets.SCOPUS_INSTTOKEN }}
MAPPED_OPENAI_APIKEY : ${{ secrets.OPENAI_APIKEY }}
MAPPED_CROSSREF_EMAIL : ${{ secrets.CROSSREF_EMAIL }}
- name: Get data and produce JSON
working-directory: ./main_folder
run: |
: # Rscript crawl.R "politics"
: # Rscript crawl.R "economics"
: # Rscript crawl.R "sociology"
Rscript crawl.R "multidisciplinary"
: # Rscript crawl.R "migration"
- name: Commit results main branch
working-directory: ./main_folder
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add . && git commit -m "Data updated"
git push origin