www-from-model/.forgejo/workflows/update-from-pool.yaml
Stephan Heunis 804b7800bd
All checks were successful
Deploy on webserver / Build site and deploy on success (push) Successful in 3m29s
Update dataset generation workflow and template to show distributions
To demo the new distriubution/filetree functionality, the workflow is updated to
inline characterized_by statements, which is filtered in the updated jinja template.
The filtering retains objects where the predicate is 'dcat:distribution' and then
does a bit more wrangling to get distributions into the generated index page.

For the demo, DataDownload documents are added in json.gz format to the studyforrest
phase 2 dataset. The workflow was run locally to update the dataset index page, and
that change is part of this commit.
2026-06-16 22:59:06 +02:00

99 lines
4.3 KiB
YAML

name: Update website sources from knowledge pool
# run daily (5:15 on weekdays) and on manual dispatch
on:
schedule:
- cron: '0 1 * * 1-5'
workflow_dispatch:
env:
DUMPTHINGS_APIURL: https://pool.psychoinformatics.de/api
QRI_RECORD_CACHE: /tmp/qri-cache
jobs:
create_pages:
runs-on: debian-latest
if: ${{ forgejo.repository == 'www/www-from-model' }}
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Prepare environment
uses: ./.forgejo/actions/prep-metadata-query
#- name: Debug
# run: |
# cat << EOT > /usr/local/bin/git-credential-echo
# #!/usr/bin/env bash
# exec cat >&2
# EOT
# chmod +x /usr/local/bin/git-credential-echo
# git config --global --add credential.helper echo
- name: git-annex init
run: |
git fetch --depth 1 origin git-annex:git-annex
git config --add annex.private true
git annex init
- name: Update navigation graph
run: |
dtc get-records ${DUMPTHINGS_APIURL} public \
| qri cache \
| python3 code/pool2graph.py > static/graph.json_new \
&& mv static/graph.json_new static/graph.json \
&& git annex add static
- name: Update objectives
run: |
qri list --class xyzri:XYZObjective \
| qri inline-records -p part_of -c public \
| qri inline-records -p depends_on -c public \
| qri render-record page_templates/objective.md.j2 'content/{__pid_curie_reference}/_index.md'
- name: Update topics
run: |
qri list --class xyzri:XYZTopic \
| qri inline-records -p part_of -c public \
| qri render-record page_templates/topic.md.j2 'content/{__pid_curie_reference}/_index.md'
- name: Update persons
run: |
qri list --class xyzri: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 page_templates/person.md.j2 \
'content/{__pid_curie_reference}/_index.md'
- name: Update projects
run: |
qri list --class xyzri:XYZProject \
| qri filter-links-pid --link part_of xyzrins:. --recursive --collection public \
| qri inject-links-pid --link generated_by generated \
| qri inject-links-pid --link part_of parts \
| qri inline-records -c public -p associated_with -p associated_with::roles -p influenced_by -p influenced_by::roles -p identifiers::creator -p part_of \
| qri render-record page_templates/project.md.j2 'content/{__pid_curie_reference}/_index.md'
- name: Update publications
run: |
qri list --class xyzri:XYZPublication \
| qri inline-records -p about -p attributed_to -c public \
| qri render-record page_templates/publication.md.j2 \
'content/{__pid_curie_reference}/_index.md'
- name: Update instruments
run: |
qri list --class xyzri:XYZInstrument \
| qri inline-records -p about -p attributed_to -p kind -p rules -c public \
| qri render-record page_templates/instrument.md.j2 \
'content/{__pid_curie_reference}/_index.md'
- name: Update datasets
run: |
qri list --class xyzri:XYZDataset \
| qri inline-records -p about -p attributed_to -p kind -p rules -p characterized_by -c public \
| qri render-record page_templates/dataset.md.j2 \
'content/{__pid_curie_reference}/_index.md'
- name: Update frontpage
run: |
qri list --pid xyzrins:. \
| qri inject-links-pid --link generated_by generated \
| qri inject-links-pid --link part_of parts \
| qri inline-records -c public -p associated_with -p associated_with::roles -p influenced_by -p influenced_by::roles -p identifiers::creator -p part_of \
| qri render-record page_templates/homepage.md.j2 'content/{__pid_curie_reference}/_index.md'
- name: Deposit changes
uses: ./.forgejo/actions/deposit-changes
- name: Deposit annex keys
run: |
git annex push
git annex push --cleanup