1- # This is a basic workflow to help you get started with Actions
1+ name : Deploy to GitHub Pages
22
3- name : CI
4-
5- # Controls when the workflow will run
63on :
7- # Triggers the workflow on push or pull request events but only for the "gh-pages" branch
84 push :
9- branches : [ "gh-pages" ]
10- pull_request :
11- branches : [ "gh-pages" ]
12-
13- # Allows you to run this workflow manually from the Actions tab
5+ branches : [ gh-pages ]
146 workflow_dispatch :
7+ schedule :
8+ - cron : " 0 7 * * 0" # Sundays 07:00 UTC
9+
10+ permissions :
11+ contents : write
12+ pages : write
13+ id-token : write
14+
15+ concurrency :
16+ group : scholar-update
17+ cancel-in-progress : true
1518
16- # A workflow run is made up of one or more jobs that can run sequentially or in parallel
1719jobs :
18- # This workflow contains a single job called "build"
1920 build :
20- # The type of runner that the job will run on
2121 runs-on : ubuntu-latest
22-
23- # Steps represent a sequence of tasks that will be executed as part of the job
2422 steps :
25- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26- - uses : actions/checkout@v4
23+ - name : Checkout your repository using git
24+ uses : actions/checkout@v4
2725
28- # Runs a single command using the runners shell
29- - name : Run a one-line script
30- run : echo Hello, world!
26+ - name : Set up Python
27+ uses : actions/setup-python@v5
28+ with :
29+ python-version : " 3.11"
3130
32- # Runs a set of commands using the runners shell
33- - name : Run a multi-line script
31+ - name : Install Python deps
3432 run : |
35- echo Add other actions to build,
36- echo test, and deploy your project.
33+ python -m pip install --upgrade pip
34+ pip install scholarly
35+ pip install bibtexparser
36+
37+ # - name: Update publications file
38+ # run: |
39+ # python scripts/update_pubs.py
40+
41+ - name : Commit & push if changed
42+ run : |
43+ if git diff --quiet; then
44+ echo "No changes to commit."
45+ exit 0
46+ fi
47+ git config user.name "github-actions[bot]"
48+ git config user.email "github-actions[bot]@users.noreply.github.com"
49+ git add -A
50+ git commit -m "chore: update publications from Google Scholar"
51+ git push
52+
53+ deploy :
54+ needs : build
55+ runs-on : ubuntu-latest
56+ environment :
57+ name : github-pages
58+ url : ${{ steps.deployment.outputs.page_url }}
59+ steps :
60+ - name : Deploy to GitHub Pages
61+ id : deployment
62+ uses : actions/deploy-pages@v4
0 commit comments