|
| 1 | +name: Build Project [using jupyter-book] |
| 2 | +on: [push] |
| 3 | +jobs: |
| 4 | +tests: |
| 5 | +runs-on: ubuntu-latest |
| 6 | +steps: |
| 7 | + - name: Checkout |
| 8 | +uses: actions/checkout@v2 |
| 9 | + - name: Setup Anaconda |
| 10 | +uses: goanpeca/setup-miniconda@v1 |
| 11 | +with: |
| 12 | +auto-update-conda: true |
| 13 | +auto-activate-base: true |
| 14 | +miniconda-version: 'latest' |
| 15 | +python-version: 3.8 |
| 16 | +environment-file: environment.yml |
| 17 | +activate-environment: qe-lectures |
| 18 | + - name: Install quantecon-book-theme |
| 19 | +shell: bash -l {0} |
| 20 | +run: | |
| 21 | + git clone https://github.com/QuantEcon/quantecon-book-theme |
| 22 | + cd quantecon-book-theme |
| 23 | + python setup.py install |
| 24 | + cd ../ && rm -rf quantecon-book-theme |
| 25 | + - name: Install sphinx-multitoc-numbering |
| 26 | +shell: bash -l {0} |
| 27 | +run: | |
| 28 | + git clone https://github.com/executablebooks/sphinx-multitoc-numbering.git |
| 29 | + cd sphinx-multitoc-numbering |
| 30 | + python setup.py install |
| 31 | + cd ../ && rm -rf sphinx-multitoc-numbering |
| 32 | + - name: Install Dependencies |
| 33 | +shell: bash -l {0} |
| 34 | +run: | |
| 35 | + pip install jupyter-book |
| 36 | + - name: Display Conda Environment Versions |
| 37 | +shell: bash -l {0} |
| 38 | +run: conda list |
| 39 | + - name: Display Pip Versions |
| 40 | +shell: bash -l {0} |
| 41 | +run: pip list |
| 42 | + - name: Build HTML |
| 43 | +shell: bash -l {0} |
| 44 | +run: | |
| 45 | + jb build lectures --path-output ./ |
| 46 | + - name: Preview Deploy to Netlify |
| 47 | +uses: nwtgck/actions-netlify@v1.1 |
| 48 | +with: |
| 49 | +publish-dir: '_build/html/' |
| 50 | +production-branch: master |
| 51 | +github-token: ${{ secrets.GITHUB_TOKEN }} |
| 52 | +deploy-message: "Preview Deploy from GitHub Actions" |
| 53 | +env: |
| 54 | +NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
| 55 | +NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |