Skip to content

Commit 2c51b25

Browse files
authored
Merge branch 'main' into dependabot/pip/certifi-2024.7.4
2 parents dbba111 + 900ecb2 commit 2c51b25

File tree

2 files changed

+34
-70
lines changed

2 files changed

+34
-70
lines changed

.github/workflows/docs.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,25 @@ on:
3636
- docs/cyclops-webpage
3737

3838
jobs:
39+
check_release:
40+
runs-on: ubuntu-latest
41+
outputs:
42+
is_release: ${{ steps.check_release.outputs.is_release }}
43+
steps:
44+
- name: Check if release PR
45+
id: check_release
46+
if: github.event_name == 'pull_request'
47+
run: |
48+
if [[ ${{ contains(github.event.pull_request.labels.*.name, 'release') }} == 'true' ]]; then
49+
echo "is_release=true" >> $GITHUB_OUTPUT
50+
else
51+
echo "is_release=false" >> $GITHUB_OUTPUT
52+
fi
53+
3954
build:
55+
needs: check_release
4056
if: github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize' || (github.event.action == 'closed' && github.event.pull_request.merged == true)))
41-
runs-on: ubuntu-latest
57+
runs-on: ${{ needs.check_release.outputs.is_release == 'true' && fromJSON('["self-hosted", "db", "cyclops"]') || 'ubuntu-latest' }}
4258
steps:
4359
- uses: actions/checkout@v4.1.7
4460
with:
@@ -49,20 +65,23 @@ jobs:
4965
with:
5066
python-version: '3.10'
5167
cache: 'poetry'
52-
- name: Install dependencies, build docs without running notebooks
68+
- name: Install dependencies, build docs
5369
run: |
5470
python3 -m pip install --upgrade pip && python3 -m pip install poetry
5571
poetry env use '3.10'
5672
source $(poetry env info --path)/bin/activate
5773
poetry install --with docs,test --all-extras
5874
59-
# Install Pandoc
60-
PANDOC_VERSION="2.19"
61-
curl -sLo- "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz" | tar xzf - --strip-components 2 -C /usr/local/bin --exclude="share"
62-
6375
cd docs
6476
rm -rf source/reference/api/_autosummary
65-
make html
77+
if [[ "${{ needs.check_release.outputs.is_release }}" == "true" ]]; then
78+
make html-with-notebooks
79+
else
80+
# Install Pandoc
81+
PANDOC_VERSION="2.19"
82+
curl -sLo- "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz" | tar xzf - --strip-components 2 -C /usr/local/bin --exclude="share"
83+
make html
84+
fi
6685
- name: Set up Node.js
6786
uses: actions/setup-node@v4.0.2
6887
with:
@@ -75,6 +94,14 @@ jobs:
7594
yarn install --frozen-lockfile
7695
yarn build
7796
cp -r ../build/html build/api
97+
- name: Fetch existing gh-pages branch
98+
if: needs.check_release.outputs.is_release != 'true'
99+
run: |
100+
git fetch origin github_pages:github_pages
101+
git checkout github_pages
102+
git checkout ${{ github.sha }} -- docs/cyclops-webpage/build
103+
git checkout github_pages -- docs/cyclops-webpage/build/api/*.html
104+
git checkout ${{ github.sha }}
78105
- name: Deploy to GitHub Pages
79106
uses: peaceiris/actions-gh-pages@v4.0.0
80107
with:

.github/workflows/docs_release.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)