-
Notifications
You must be signed in to change notification settings - Fork 27
44 lines (42 loc) · 1.31 KB
/
rebuild.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
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: pip install -r requirements.txt
- name: Rebuild citation
run: |
python src/rebuild_citation.py
python src/update_readme.py
- name: Commit and push if needed
if: ${{ github.event_name == 'push' }}
run: |-
git diff
git config --global user.email "rebuild-bot@example.com"
git config --global user.name "rebuild-bot"
git add -A
git commit -m "[Rebuild-Bot] rebuild citation automatically" || exit 0
git push