Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 12 additions & 69 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,91 +1,34 @@
# See: https://circleci.com/docs/2.0/language-python/
version: 2.1

version: 2
jobs:

jobs:
build-docs:
working_directory: ~/repo
docker:
- image: cimg/python:3.13

steps:
- checkout

- run:
name: Install Python dependencies
command: |
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
python -m pip install --upgrade pip tox

- run:
name: Build site
no_output_timeout: 30m
name: Build documentation
no_output_timeout: 60m
environment:
# Ensure this is same as store_artifacts path below
DOCS_PATH: _build/html
command: |
# NOTE: blas multithreading behaves badly on circleci
export BASE_URL="/output/job/$CIRCLE_WORKFLOW_JOB_ID/artifacts/0/$DOCS_PATH"
export OMP_NUM_THREADS=1
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
python -m tox -e py313-buildhtml

- store_artifacts:
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

path: _build/html

workflows:
version: 2
build:
build-and-docs:
jobs:
- build-docs
- deploy-docs:
requires:
- build-docs
filters:
branches:
only: main
46 changes: 46 additions & 0 deletions .github/workflows/ci_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ 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 <--"
Loading