www.trr379.de/.forgejo/workflows/publications.yml
2026-06-26 08:57:48 +02:00

72 lines
2.2 KiB
YAML

name: Create publication pages
# run daily (5:15 on weekdays) and on manual dispatch
on:
schedule:
- cron: '15 5 * * 1-5'
workflow_dispatch:
env:
POOLAPI: https://pool.v0.trr379.de/api
jobs:
create_pages:
runs-on: debian-latest
if: ${{ forgejo.repository == 'q04/www.trr379.de' }}
steps:
- name: Checkout this
id: websitecheckout
uses: https://hub.datalad.org/forgejo/datalad-clone-action@v1
with:
ref: main
get_file_content: false
recursive: false
- name: Checkout code
id: codecheckout
uses: https://hub.datalad.org/forgejo/datalad-clone-action@v1
with:
repository: q02/pool-publication-page
path: code
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install git-annex
run: uv tool install git-annex
- name: Install qrg & dtc suites
run: |
uv tool install https://hub.psychoinformatics.de/orinoco/query-things.git
uv tool install dump-things-pyclient
- name: Configure Git
run: |
git config --global user.name "Forgejo Actions"
git config --global user.email "forgejo-actions@hub.trr379.de"
git config --global credential.helper cache
git credential approve <<EOF
url=${{ forgejo.server_url }}
username=${{ forgejo.actor }}
password=${{ forgejo.token }}
EOF
echo OK
- name: Process metadata
run: |
cd ${{ steps.codecheckout.outputs.path }}
uv sync
mkdir .cache
dtc read-pages ${POOLAPI}/public/records/p/TRR379Person > .cache/Person.jsonl
dtc read-pages ${POOLAPI}/public/records/p/TRR379Publication \
| qrg inline-records --api-url ${POOLAPI}/ -c public -p attributed_to -p attributed_to::roles \
| uv run filters/enrich-via-doi.py --extras - .cache/Person.jsonl - \
| uv run publication.py - ${{ steps.websitecheckout.outputs.path }}/content/publications
- name: Commit and push updates
id: commit
run: |
git add content/publications
git commit -m "Auto-update publications" || true
git push origin