diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7591f0c..7b5ca291 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: Build Project [using jupyter-book] on: [push] jobs: - tests: + preview: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 09182942..e98db956 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,7 +4,7 @@ on: branches: - master jobs: - tests: + publish: runs-on: ubuntu-latest steps: - name: Checkout @@ -32,11 +32,32 @@ jobs: shell: bash -l {0} run: | jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter + - name: Copy Download Notebooks for GH-PAGES + shell: bash -l {0} + run: | mkdir _build/html/_notebooks cp _build/jupyter/*.ipynb _build/html/_notebooks - - name: Deploy + - name: Deploy website to gh-pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: _build/html/ - cname: python-programming.quantecon.org \ No newline at end of file + cname: python-programming.quantecon.org + - name: Prepare lecture-python-programming.notebooks sync + shell: bash -l {0} + run: | + mkdir -p _build/lecture-python-programming.notebooks + cp -a _notebook_repo/. _build/lecture-python-programming.notebooks + cp _build/jupyter/*.ipynb _build/lecture-python-programming.notebooks + ls -a _build/lecture-python-programming.notebooks + - name: Commit latest notebooks to lecture-python-programming.notebooks + uses: cpina/github-action-push-to-another-repository@master + env: + API_TOKEN_GITHUB: ${{ secrets.QUANTECON_SERVICES_PAT }} + with: + source-directory: '_build/lecture-python-programming.notebooks/' + destination-repository-username: 'QuantEcon' + destination-repository-name: 'lecture-python-programming.notebooks' + commit-message: 'auto publishing updates to notebooks' + destination-github-username: 'quantecon-services' + user-email: services@quantecon.org diff --git a/_notebook_repo/README.md b/_notebook_repo/README.md new file mode 100644 index 00000000..3bd13ee4 --- /dev/null +++ b/_notebook_repo/README.md @@ -0,0 +1,7 @@ +# lecture-python-programming.notebooks + +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/QuantEcon/lecture-python-programming.notebooks/master) + +Notebooks for https://python-programming.quantecon.org + +**Note:** This README should be edited [here](https://github.com/quantecon/lecture-python-programming.myst/.binder) diff --git a/_notebook_repo/environment.yml b/_notebook_repo/environment.yml new file mode 100644 index 00000000..de38000a --- /dev/null +++ b/_notebook_repo/environment.yml @@ -0,0 +1,17 @@ +name: lecture-python-programming +channels: + - default +dependencies: + - python=3.8 + - anaconda + - pip + - pip: + - git+https://github.com/executablebooks/jupyter-book.git + - sphinxext-rediraffe + - git+https://github.com/executablebooks/sphinx-multitoc-numbering + - git+https://github.com/executablebooks/sphinx-exercise.git + - joblib + - interpolation + - git+https://github.com/QuantEcon/sphinx-tojupyter.git + - git+https://github.com/QuantEcon/quantecon-book-theme.git +