www-from-model/.forgejo/workflows/update_person_pages.yaml
Stephan Heunis b104cca870 Only add necessary keys to frontmatter
This goes along with a change to qri, where the data is included as a
python dictionary at a specific key, and the toyaml filter is made
available to the jinja template. The jinja template then extracts the
keys that it needs and adds it to a dictionary, then runs it through
the toyaml filter to add everything to frontmatter
2026-03-07 14:34:10 +01:00

45 lines
1.6 KiB
YAML

name: Update person pages
on:
schedule:
- cron: '0 3 * * 1-5'
workflow_dispatch:
env:
DUMPTHINGS_APIURL: https://pool.psychoinformatics.de/api
jobs:
create_pages:
runs-on: debian-latest
if: ${{ forgejo.repository == 'www/www-from-model' }}
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: Prepare environment
uses: ./.forgejo/actions/prep-metadata-query
# this step clones code for additional record processing and filtering.
# TODO: that code needs to be generalized before being used here, maybe
# also come from a more central/generic repo than the trr resources
#- name: Checkout code
# id: codecheckout
# uses: https://hub.datalad.org/forgejo/datalad-clone-action@v1
# with:
# repository: https://hub.trr379.de/q02/pool-publication-page
# get_file_content: false
- name: Process metadata
run: |
dtc get-records ${DUMPTHINGS_APIURL} public -C XYZPerson \
| qri filter-linked-pid public xyzrins:. associated_with \
| qri inline-records -c public -p delegated_by -p delegated_by::roles -p identifiers::creator \
| qri render-record --include-data-at-key param_context page_templates/person.md.j2 'content/{__pid_curie_reference}/_index.md'
- name: Deposit changes
uses: ./.forgejo/actions/deposit-changes