From 26b4919acba46f67026362fe28b6f80d62367690 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 18 Jan 2024 10:07:11 +1100 Subject: [PATCH] Update gh-actions and customize publish script to context --- .github/workflows/execution.yml | 111 -------------------------------- .github/workflows/publish.yml | 20 +++--- 2 files changed, 10 insertions(+), 121 deletions(-) delete mode 100644 .github/workflows/execution.yml diff --git a/.github/workflows/execution.yml b/.github/workflows/execution.yml deleted file mode 100644 index f36dfbb..0000000 --- a/.github/workflows/execution.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: Run Execution Tests [Latest Anaconda] -on: - schedule: - # UTC 22:00 is early morning in Australia - - cron: '0 22 * * *' -jobs: - execution-tests-linux: - name: Execution Tests (${{ matrix.python-version }}, ${{ matrix.os }}) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest"] - python-version: ["3.11"] - steps: - - name: Checkout - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - - name: Install latex dependencies - run: | - sudo apt-get -qq update - sudo apt-get install -y \ - texlive-latex-recommended \ - texlive-latex-extra \ - texlive-fonts-recommended \ - texlive-fonts-extra \ - texlive-xetex \ - latexmk \ - xindy \ - dvipng \ - cm-super - - name: Install Anaconda + Dependencies - shell: bash -l {0} - run: | - conda install anaconda - pip install jupyter-book sphinx-multitoc-numbering quantecon-book-theme sphinxext-rediraffe sphinx-tojupyter sphinxcontrib-youtube sphinx-exercise prettytable - - name: Build Lectures (+ Execution Checks) - shell: bash -l {0} - run: jb build lectures --path-output=./ -W --keep-going - - name: Upload Execution Reports - uses: actions/upload-artifact@v2 - if: failure() - with: - name: execution-reports - path: _build/html/reports - - execution-tests-osx: - name: Execution Tests (${{ matrix.python-version }}, ${{ matrix.os }}) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["macos-latest"] - python-version: ["3.11"] - steps: - - name: Checkout - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - - name: Install latex dependencies - run: | - brew install texlive - - name: Install Anaconda + Dependencies - shell: bash -l {0} - run: | - conda install anaconda - pip install jupyter-book sphinx-multitoc-numbering quantecon-book-theme sphinxext-rediraffe sphinx-tojupyter sphinxcontrib-youtube sphinx-exercise prettytable - - name: Build Lectures (+ Execution Checks) - shell: bash -l {0} - run: jb build lectures --path-output=./ -W --keep-going - - name: Upload Execution Reports - uses: actions/upload-artifact@v2 - if: failure() - with: - name: execution-reports - path: _build/html/reports - # execution-tests-win: - # name: Execution Tests (${{ matrix.python-version }}, ${{ matrix.os }}) - # runs-on: ${{ matrix.os }} - # strategy: - # fail-fast: false - # matrix: - # os: ["windows-latest"] - # python-version: ["3.11"] - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - # - uses: conda-incubator/setup-miniconda@v2 - # with: - # auto-update-conda: true - # python-version: ${{ matrix.python-version }} - # - name: Install Anaconda + Dependencies - # shell: powershell - # run: | - # conda install anaconda - # pip install jupyter-book - # pip install jupyter-book sphinx-multitoc-numbering quantecon-book-theme sphinxext-rediraffe sphinx_tojupyter - # - name: Build Lectures (+ Execution Checks) - # shell: powershell - # run: jb build lectures --path-output=./ -W --keep-going - # - name: Upload Execution Reports - # uses: actions/upload-artifact@v2 - # if: failure() - # with: - # name: execution-reports - # path: _build/html/reports diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2a12516..f139e2c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -88,24 +88,24 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: _build/html/ - cname: python.quantecon.org - - name: Prepare lecture-python.notebooks sync + cname: stats.quantecon.org + - name: Prepare lecture-stats.notebooks sync shell: bash -l {0} run: | - mkdir -p _build/lecture-python.notebooks - cp -a _notebook_repo/. _build/lecture-python.notebooks - cp _build/jupyter/*.ipynb _build/lecture-python.notebooks - ls -a _build/lecture-python.notebooks - - name: Commit notebooks to lecture-python.notebooks + mkdir -p _build/lecture-stats.notebooks + cp -a _notebook_repo/. _build/lecture-stats.notebooks + cp _build/jupyter/*.ipynb _build/lecture-stats.notebooks + ls -a _build/lecture-stats.notebooks + - name: Commit notebooks to lecture-stats.notebooks shell: bash -l {0} env: QE_SERVICES_PAT: ${{ secrets.QUANTECON_SERVICES_PAT }} run: | - git clone https://quantecon-services:$QE_SERVICES_PAT@github.com/quantecon/lecture-python.notebooks + git clone https://quantecon-services:$QE_SERVICES_PAT@github.com/quantecon/lecture-stats.notebooks - cp _build/lecture-python.notebooks/*.ipynb lecture-python.notebooks + cp _build/lecture-stats.notebooks/*.ipynb lecture-stats.notebooks - cd lecture-python.notebooks + cd lecture-stats.notebooks git config user.name "QuantEcon Services" git config user.email "admin@quantecon.org" git add *.ipynb