Add workflow for project page generation (combined with contributors) #23
2 changed files with 36 additions and 30 deletions
|
|
@ -1,16 +1,17 @@
|
|||
name: Create publication pages
|
||||
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' }}
|
||||
outputs:
|
||||
committed: ${{ steps.commit.outputs.committed }}
|
||||
|
||||
steps:
|
||||
- name: Checkout this
|
||||
|
|
@ -58,21 +59,35 @@ jobs:
|
|||
EOF
|
||||
echo OK
|
||||
|
||||
- name: Process metadata
|
||||
- name: Sync the env and prefetch some data
|
||||
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 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: Commit and push updates
|
||||
id: commit
|
||||
run: |
|
||||
git add content/contributors
|
||||
git commit -m "Auto-update contributors" && result=t || result=nil
|
||||
git diff --quiet --cached && echo "Already up-to-date" || git commit -m "Auto-update 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
|
||||
git add content/projects
|
||||
git diff --quiet --cached && echo "Already up-to-date" || git commit -m "Auto-update projects"
|
||||
|
||||
- name: Push updates
|
||||
run: |
|
||||
git push origin
|
||||
echo "committed=${result}" >> $FORGEJO_OUTPUT
|
||||
|
|
@ -6,12 +6,13 @@ on:
|
|||
- 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' }}
|
||||
outputs:
|
||||
committed: ${{ steps.commit.outputs.committed }}
|
||||
|
||||
steps:
|
||||
- name: Checkout this
|
||||
|
|
@ -57,9 +58,9 @@ jobs:
|
|||
cd ${{ steps.codecheckout.outputs.path }}
|
||||
uv sync
|
||||
mkdir .cache
|
||||
dtc read-pages https://pool.v0.trr379.de/api/public/records/p/TRR379Person > .cache/Person.jsonl
|
||||
dtc read-pages https://pool.v0.trr379.de/api/public/records/p/TRR379Publication \
|
||||
| qrg inline-records --api-url https://pool.v0.trr379.de/api/ -c public -p attributed_to \
|
||||
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 \
|
||||
| uv run filters/enrich-via-doi.py --extras - .cache/Person.jsonl - \
|
||||
| uv run publication.py - ${{ steps.websitecheckout.outputs.path }}/content/publications
|
||||
|
||||
|
|
@ -67,15 +68,5 @@ jobs:
|
|||
id: commit
|
||||
run: |
|
||||
git add content/publications
|
||||
git commit -m "Auto-update publications" && result=t || result=nil
|
||||
git commit -m "Auto-update publications" || true
|
||||
git push origin
|
||||
echo "committed=${result}" >> $FORGEJO_OUTPUT
|
||||
|
||||
|
||||
# deploy_created_pages:
|
||||
# # pushes using automatic token don't trigger on-push jobs
|
||||
# needs:
|
||||
# - create_pages
|
||||
# if: ${{ needs.create_pages.outputs.committed == 't' }}
|
||||
# runs-on: trr379-hugo-site-build
|
||||
# uses: ./.forgejo/workflows/deploy.yml
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue