diff --git a/.github/workflows/update_docs.yml b/.github/workflows/update_docs.yml new file mode 100644 index 0000000..c5f377a --- /dev/null +++ b/.github/workflows/update_docs.yml @@ -0,0 +1,37 @@ + +name: CI + +on: +- pull_request: + types: + - closed +- workflow_dispatch + +jobs: + if_merged: + if: github.event.pull_request.merged == true + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: s-weigand/setup-conda@v1 + - run: conda config --append channels conda-forge + - run: python3 -m pip install -r requirements.txt + - run: conda install -y pandoc==2.17 + - run: pip install sphinx-mathjax-offline + + - run: | + git clone https://github.com/openmlsys/d2l-book.git + cd d2l-book + python3 -m pip install . + - run: sh build_html.sh + - run: cd .. + - run: git clone https://github.com/openmlsys/openmlsys.github.io.git + - run: cp -r openmlsys-zh/_build/html/* openmlsys.github.io/docs/ + - run: | + cd openmlsys.github.io + git add . + git commit -m 'update docs' + git push + + +