diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index d428ad81bb0..73f82b167fc 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -151,32 +151,6 @@ jobs: target: panda cache-from: type=registry,ref=pandare/pandadev:cache cache-to: type=registry,ref=pandare/panda:cache,mode=max - - - name: Checkout docs and reset - run: rm -rf "${GITHUB_WORKSPACE}/auto_pydoc"; - 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 - - - name: Update PYPANDA docs in container - run: docker run --rm -v ${GITHUB_WORKSPACE}/auto_pydoc:/out pandare/pandadev:latest /bin/sh -c "pip3 install pdoc3==0.10.0; cd /panda/panda/python/core; pdoc3 --html --template-dir=../docs/template --force -o /out/${GITHUB_REF##*/} pandare; chmod -R 777 /out/" - - # will put docs in workspace/auto_pydoc/dev/pandare and/or workspace/auto_pydoc/stable/pandare - # we want to copy auto_pydoc/dev/pandare to auto_pydoc/pandare/ and /auto_pydoc/stable/pandare to /auto_pydoc/pandare/stable - # - # This is a bit complicated, sorry. We want to keep pandare/{CNAME,.git/} and nothing else - # then we copy in the new files (and merge doc-search.html and index.js with dev/pandare/ - - name: Push PYPANDA docs to GitHub Pages if docs changed - run: cd "${GITHUB_WORKSPACE}/auto_pydoc" && - mv pandare/CNAME dev && - rm -rf pandare/* && - mv dev/pandare/* pandare && - rmdir dev/pandare && - mv dev/* pandare/ && - cd pandare && - git config --global user.email "panda-ci@panda-re.mit.edu" && - git config --global user.name "PANDA Bot" && - git add . && - git commit -m "Documentation update for PANDA commit ${{ github.sha }} branch dev" && - git push || true build_stable: if: github.repository == 'panda-re/panda' && github.ref == 'refs/heads/stable' @@ -201,28 +175,34 @@ jobs: pandare/panda_stable:${{ github.sha }} pandare/panda_stable:latest target: panda - + + update_documentation: + runs-on: panda-arc + needs: [build_stable, upload_release_assets] + if: ${{ github.repository == 'panda-re/panda' && (needs.build_stable.result == 'success' || needs.upload_release_assets.result == 'success') }} + steps: - name: Checkout docs and reset run: rm -rf "${GITHUB_WORKSPACE}/auto_pydoc"; 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 - name: Update PYPANDA docs in container run: docker run --rm -v ${GITHUB_WORKSPACE}/auto_pydoc/pandare:/out pandare/pandadev:latest /bin/sh -c "pip3 install pdoc3==0.10.0; cd /panda/panda/python/core; pdoc3 --html --template-dir=../docs/template --force -o /out/${GITHUB_REF##*/} pandare; chmod -R 777 /out/" - - # will put docs in workspace/auto_pydoc/dev/pandare and/or workspace/auto_pydoc/stable/pandare - # we want to copy /auto_pydoc/dev/pandare to /auto_doc and /auto_pydoc/stable/pandare to /auto_pydoc/stable - # - # This is a bit complicated, sorry. We create a directory stable and combine doc-search.html and index.js in there. + + # will put docs in workspace/auto_pydoc/{dev, stable}/pandare and/or workspace/auto_pydoc/stable/pandare + # we want to copy auto_pydoc/{dev, stable}/pandare to auto_pydoc/pandare/ and /auto_pydoc/stable/pandare to /auto_pydoc/pandare/stable + # + # This is a bit complicated, sorry. We want to keep pandare/{CNAME,.git/} and nothing else + # then we copy in the new files (and merge doc-search.html and index.js with {dev, stable}/pandare/ - name: Push PYPANDA docs to GitHub Pages if docs changed - #run: cd "${GITHUB_WORKSPACE}/auto_pydoc/pandare" && mv ./stable ./stable2; mv ./stable2/pandare stable; rm -rf ./stable2; run: cd "${GITHUB_WORKSPACE}/auto_pydoc" && - rm -rf pandare/stable && - mv stable/pandare/* pandare/stable && - rmdir stable/pandare && - mv stable/* pandare/stable && - cd pandare && - git config --global user.email "panda-ci@panda-re.mit.edu" && - git config --global user.name "PANDA Bot" && - git add . && - git commit -m "Documentation update for PANDA commit ${{ github.sha }} branch stable" && - git push || true + mv pandare/CNAME ${{ github.ref_name }} && + rm -rf pandare/* && + mv ${{ github.ref_name }}/pandare/* pandare && + rmdir ${{ github.ref_name }}/pandare && + mv ${{ github.ref_name }}/* pandare/ && + cd pandare && + git config --global user.email "panda-ci@panda-re.mit.edu" && + git config --global user.name "PANDA Bot" && + git add . && + git commit -m "Documentation update for PANDA commit ${{ github.sha }} branch ${{ github.ref_name }}" && + git push || true