Skip to content

Commit 840acd9

Browse files
AndrewQuijanolacraig2
authored andcommitted
Restore automatic PANDA documentation updates
1 parent 4a02419 commit 840acd9

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/publish_docker.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,34 @@ jobs:
232232
files: |
233233
dist/*
234234
debs/**/*.deb
235+
236+
documentation:
237+
if: github.repository == 'panda-re/panda'
238+
needs: build_release_assets
239+
runs-on: panda-arc
240+
steps:
241+
- name: Checkout docs and reset
242+
run: |
243+
rm -rf "${GITHUB_WORKSPACE}/auto_pydoc";
244+
git clone https://panda-jenkins-ci:${{ secrets.PANDABOT_GITHUB_API }}@github.com/panda-re/panda-re.github.io.git --branch=master ${GITHUB_WORKSPACE}/auto_pydoc/pandare
245+
246+
- name: Update PYPANDA docs in container
247+
run: docker run --rm -v ${GITHUB_WORKSPACE}/auto_pydoc:/out pandare/pandadev:latest /bin/sh -c "pip3 install pdoc3; cd /panda/panda/python/core; pdoc3 --html --template-dir=../docs/template --force -o /out/${GITHUB_REF##*/} pandare; chmod -R 777 /out/"
248+
# will put docs in workspace/auto_pydoc/dev/pandare and/or workspace/auto_pydoc/<branch>/pandare
249+
# we want to copy auto_pydoc/dev/pandare to auto_pydoc/pandare/ and /auto_pydoc/<branch>/pandare to /auto_pydoc/pandare/<branc>
250+
#
251+
# This is a bit complicated, sorry. We want to keep pandare/{CNAME,.git/} and nothing else
252+
# then we copy in the new files (and merge doc-search.html and index.js with <branch>/pandare/
253+
- name: Push PYPANDA docs to GitHub Pages if docs changed
254+
run: cd "${GITHUB_WORKSPACE}/auto_pydoc" &&
255+
mv pandare/CNAME ${{ github.ref_name }} &&
256+
rm -rf pandare/* &&
257+
mv ${{ github.ref_name }}/pandare/* pandare &&
258+
rmdir ${{ github.ref_name }}/pandare &&
259+
mv ${{ github.ref_name }}/* pandare/ &&
260+
cd pandare &&
261+
git config --global user.email "[email protected]" &&
262+
git config --global user.name "PANDA Bot" &&
263+
git add . &&
264+
git commit -m "Documentation update for PANDA commit ${{ github.sha }} branch ${{ github.ref_name }}" &&
265+
git push || true

0 commit comments

Comments
 (0)