1
0
Fork 0
forked from q04/www.trr379.de
www.trr379.de/.forgejo/workflows/publications.yml

70 lines
2.1 KiB
YAML

name: Create publication pages
# run daily (5:15 on weekdays) and on manual dispatch
on:
schedule:
- cron: '15 5 * * 1-5'
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
#ref: 40abf1d1b2636931c4d2c2173587772f6bca7b63 # be explicit
path: code
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install git-annex
run: 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: Process metadata
run: |
( cd ${{ steps.codecheckout.outputs.path }} && uv run main.py --outdir ${{ steps.websitecheckout.outputs.path }}/content/publications )
- name: Commit and push updates
id: commit
run: |
git add content/publications
git commit -m "Auto-update publications" && result=t || result=nil
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