Skip to content

Commit

Permalink
Add a Circle CI job to show a preview of the docs on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
asmeurer committed May 4, 2022
1 parent 21b3279 commit df241d6
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2

# Aliases to reuse
_defaults: &defaults
docker:
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
- image: cimg/python:3.10.2
working_directory: ~/repo

jobs:
build_page:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/
- run:
name: build docs
no_output_timeout: 25m
command: |
cd doc
pip install -r requirements.txt
make html
- store_artifacts:
path: _build/html

workflows:
version: 2
default:
jobs:
- build_page
19 changes: 19 additions & 0 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on: [status]
jobs:
circleci_artifacts_redirector_job:
# Don't run Action on forks, and allow skipping CI
if: "github.repository == 'sympy/sympy'"
runs-on: ubuntu-latest
name: Run CircleCI artifacts redirector
steps:
- name: GitHub Action step
id: step1
uses: larsoner/circleci-artifacts-redirector-action@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifact-path: 0/_build/html/index.html
circleci-jobs: build_page
job-title: Click here to see a preview of the documentation.
- name: Array API preview
run: |
curl --fail ${{ steps.step1.outputs.url }} | grep $GITHUB_SHA

0 comments on commit df241d6

Please sign in to comment.