www/.forgejo/workflows/contributors-projects.yml
Michał Szczepanik df5412f0e0 ci: adapt to breaking change of join-association CLI
The CLI of join-association.py was changed to require explicit output
declaration (with - being stdout), making it consistent with other
filters in that project, in (1). This commit accounts for that change.

7f894c5bd0
2026-03-29 20:02:37 +00:00

94 lines
3.5 KiB
YAML

name: Create contributor and project pages
on:
schedule:
- cron: '6 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
get_file_content: false
path: code
- name: Download extra data
id: datacheckout
uses: https://hub.datalad.org/forgejo/datalad-clone-action@v1
with:
repository: q02/ror-data-copy
path: /tmp/extradata
get_content: v2.2-2026-01-29-ror-data.parquet
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install qrg & dtc suites, and git-annex
run: |
uv tool install https://hub.psychoinformatics.de/datalink/query-rse-group.git
uv tool install dump-things-pyclient
uv tool install git-annex
- 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: Sync the env and prefetch some data
run: |
cd ${{ steps.codecheckout.outputs.path }}
uv sync
mkdir .cache
dtc read-pages ${POOLAPI}/public/records/p/TRR379Project > .cache/projects.jsonl
dtc get-records --pid "trr379root:." https://pool.v0.trr379.de/api/ public > .cache/trr379.jsonl
- name: Process contributors
run: |
cd ${{ steps.codecheckout.outputs.path }}
dtc read-pages ${POOLAPI}/public/records/p/TRR379Person \
| qrg inline-records --api-url ${POOLAPI}/ -c public -p delegated_by \
| uv run filters/join-association.py --inline --pop --field-name x_associated_projects - .cache/projects.jsonl associated_with - \
| uv run filters/infer-site.py - ${{ steps.datacheckout.outputs.path }}/v2.2-2026-01-29-ror-data.parquet - \
| uv run person.py - ${{ steps.websitecheckout.outputs.path }}/content/contributors
- name: Process projects
run: |
cd ${{ steps.codecheckout.outputs.path }}
cat .cache/projects.jsonl \
| qrg inline-records --api-url https://pool.v0.trr379.de/api/ -c public -p associated_with \
| uv run filters/join-association.py --field-name x_had_influence - .cache/trr379.jsonl influenced_by - \
| uv run project.py - ${{ steps.websitecheckout.outputs.path }}/content/projects
- name: Commit and push updates
run: |
cd ${{ steps.websitecheckout.outputs.path }}
git add content/contributors
git diff --quiet --cached && echo "Contributors already up-to-date" || git commit -m "Auto-update contributors"
git add content/projects
git diff --quiet --cached && echo "Projects already up-to-date" || git commit -m "Auto-update projects"
git push origin