41 lines
1.4 KiB
YAML
41 lines
1.4 KiB
YAML
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
|
|
jobs:
|
|
build-publish:
|
|
runs-on: docker-bookworm
|
|
container:
|
|
image: 'code.forgejo.org/oci/node:20-bookworm'
|
|
steps:
|
|
- uses: https://code.forgejo.org/actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: build HTML pages
|
|
run: |
|
|
set -x
|
|
curl -sSL https://install.python-poetry.org | POETRY_HOME=/etc/poetry python3 -
|
|
/etc/poetry/bin/poetry config virtualenvs.in-project true
|
|
/etc/poetry/bin/poetry install -vv
|
|
cd doc
|
|
/etc/poetry/bin/poetry run make clean html
|
|
- name: publish
|
|
if: github.event_name == 'push'
|
|
run: |
|
|
set -x # secrets.TOKEN will be redacted
|
|
commit_message="$(git --no-pager show --format=format:%s -s ${{ github.event.sha }})"
|
|
git clone https://code.forgejo.org/f3/html-documentation.git /tmp/doc
|
|
rm -fr /tmp/doc/*
|
|
cp -a doc/_build/html/* /tmp/doc/
|
|
cd /tmp/doc
|
|
git add .
|
|
git config --global user.email "contact@forgefriends.org"
|
|
git config --global user.name "F3 Authors"
|
|
if git commit -m "${commit_message}" ; then
|
|
git push https://anyuser:${{ secrets.TOKEN }}@code.forgejo.org/f3/html-documentation HEAD:main
|
|
else
|
|
echo no update, do nothing
|
|
fi
|