diff --git a/.circleci/config.yml b/.circleci/config.yml index c701888d..5e482ebe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,34 +1,91 @@ -version: 2.1 - +# See: https://circleci.com/docs/2.0/language-python/ +version: 2 jobs: + build-docs: + working_directory: ~/repo docker: - image: cimg/python:3.13 + steps: - checkout - run: name: Install Python dependencies command: | - python -m pip install --upgrade pip tox + python3 -m venv venv + source venv/bin/activate + pip install --upgrade pip wheel setuptools + pip install -r site/requirements.txt -r requirements.txt + + - restore_cache: + keys: + - cache-data - run: - name: Build documentation - no_output_timeout: 60m - environment: - # Ensure this is same as store_artifacts path below - DOCS_PATH: _build/html + name: Build site + no_output_timeout: 30m command: | - export BASE_URL="/output/job/$CIRCLE_WORKFLOW_JOB_ID/artifacts/0/$DOCS_PATH" + # NOTE: blas multithreading behaves badly on circleci export OMP_NUM_THREADS=1 - python -m tox -e py313-buildhtml + source venv/bin/activate + # n = nitpicky (broken links), W = warnings as errors, + # T = full tracebacks, keep-going = run to completion even with errors + make -C site/ SPHINXOPTS="-nWT --keep-going" html + + - save_cache: + key: cache-data + paths: + - _data - store_artifacts: - path: _build/html + path: site/_build/html + + - persist_to_workspace: + root: site/_build + paths: html + + deploy-docs: + working_directory: ~/repo + docker: + - image: cimg/python:3.13 + steps: + - checkout + + - attach_workspace: + at: site/_build + + - run: + name: install deploy deps + command : | + python3 -m pip install --user ghp-import + + - run: + name: configure git + command: | + git config --global user.name "ci-doc-deploy-bot" + git config --global user.email "ci-doc-deploy-bot@nomail" + git config --global push.default simple + + - add_ssh_keys: + fingerprints: + 5c:54:62:37:75:7f:4d:14:f4:07:82:1c:50:0d:ee:9b + + - run: + name: deploy to gh-pages + command: | + ghp-import -n -f -p -m "[skip ci] docs build of $CIRCLE_SHA1" site/_build/html + workflows: version: 2 - build-and-docs: + build: jobs: - build-docs + - deploy-docs: + requires: + - build-docs + filters: + branches: + only: main diff --git a/.github/workflows/ci_publish.yml b/.github/workflows/ci_publish.yml deleted file mode 100644 index 510284af..00000000 --- a/.github/workflows/ci_publish.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Build and Publish HTML and deployed_notebooks - -on: - push: - branches: - - main - schedule: - - cron: '0 5 * * 1' - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - # `BASE_URL` determines, relative to the root of the domain, the URL that your site is served from. - # E.g., if your site lives at `https://mydomain.org/myproject`, set `BASE_URL=/myproject`. - # If, instead, your site lives at the root of the domain, at `https://mydomain.org`, set `BASE_URL=''`. - BASE_URL: /${{ github.event.repository.name }} - -jobs: - - publish_html: - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - name: Publish HTML - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: '3.12' - - - name: Install dependencies - run: python -m pip install --upgrade tox - - - name: Execute notebooks while building HTMLs - run: tox -e py312-buildhtml - - - name: Publish - uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./_build/html/ - commit_message: ${{ github.event.head_commit.message }} diff --git a/.github/workflows/circleci-artifacts-redirector.yml b/.github/workflows/circleci.yml similarity index 83% rename from .github/workflows/circleci-artifacts-redirector.yml rename to .github/workflows/circleci.yml index 95a7e6b8..35c4c076 100644 --- a/.github/workflows/circleci-artifacts-redirector.yml +++ b/.github/workflows/circleci.yml @@ -11,5 +11,3 @@ jobs: api-token: ${{ secrets.CIRCLE_TOKEN }} artifact-path: 0/site/_build/html/index.html circleci-jobs: build-docs - domain: circle.scientific-python.dev - job-title: "--> Rendering Preview <--"