From 9b039c384de7bb638f2343dce5e80ee6a951f2c8 Mon Sep 17 00:00:00 2001 From: Jiarong Han <73918561+hanjr92@users.noreply.github.com> Date: Mon, 20 Jun 2022 17:24:36 +0800 Subject: [PATCH] Create update_docs.yml (#380) test auto update docs --- .github/workflows/update_docs.yml | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/update_docs.yml 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 + + +