Add a workflow for generating contributor pages #18
1 changed files with 75 additions and 0 deletions
75
.forgejo/workflows/contributors.yml
Normal file
75
.forgejo/workflows/contributors.yml
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
name: Create publication pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create_pages:
|
||||||
|
runs-on: debian-latest
|
||||||
|
if: ${{ forgejo.repository == 'q04/www.trr379.de' }}
|
||||||
|
outputs:
|
||||||
|
committed: ${{ steps.commit.outputs.committed }}
|
||||||
|
|
||||||
|
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: https://hub.trr379.de/q02/pool-publication-page
|
||||||
|
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
|
||||||
|
run: |
|
||||||
|
uv tool install https://hub.psychoinformatics.de/datalink/query-rse-group.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 --locked
|
||||||
|
dtc read-pages https://pool.v0.trr379.de/api/public/records/p/TRR379Project > /tmp/projects.jsonl
|
||||||
|
dtc read-pages https://pool.v0.trr379.de/api/public/records/p/TRR379Person \
|
||||||
|
| qrg inline-records --api-url https://pool.v0.trr379.de/api/ -c public -p delegated_by \
|
||||||
|
| uv run filters/join-association.py --inline --pop --field-name x_associated_projects - /tmp/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: Commit and push updates
|
||||||
|
id: commit
|
||||||
|
run: |
|
||||||
|
git add content/contributors
|
||||||
|
msz marked this conversation as resolved
Outdated
|
|||||||
|
git commit -m "Auto-update publications" && result=t || result=nil
|
||||||
|
git push origin
|
||||||
|
echo "committed=${result}" >> $FORGEJO_OUTPUT
|
||||||
Loading…
Add table
Add a link
Reference in a new issue
I have not run the code in this action, but I noticed when skimming though that the "process metadata" step uses
person.pyto create contents in{...}/contents/contributors, but thisgit addstagescontent/publications, and the commit message is on updating publication. Am I missing something, or is this a copy-paste error from a different action?Copy-paste error. I knew it wouldn't work on the first try - thank you for spotting that!