Skip to content

Commit

Permalink
Modify deploy to use PST switcher instead of Sphinx-Multiversion
Browse files Browse the repository at this point in the history
  • Loading branch information
CAM-Gerlach committed Aug 1, 2024
1 parent ac02eae commit cd1849c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 92 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,47 @@ on: # yamllint disable-line rule:truthy
- '*.*'
- 'staging*'

permissions:
contents: write

jobs:
build:
name: Build and Deploy

runs-on: ubuntu-latest

env:
IS_DEPLOY: ${{ ((github.event_name == 'push' && '1') || '0' }}
IS_STAGING: ${{ ((github.ref == 'refs/heads/staging' && '1') || '0' }}
IS_MAIN: ${{ ((github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && '1') || '0' }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.11'
- name: Install dependencies
shell: bash
run: ./ci/install.sh
- name: List dependencies
shell: bash
run: pip list
run: |
echo $IS_DEPLOY
echo $IS_PROD
echo $IS_MAIN
pip list
- name: Build site
shell: bash
run: ./ci/build.sh
- name: Build site
shell: bash
run: make multidocs
- name: Deploy to GitHub Pages
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && github.event_name != 'pull_request'
if: env.IS_DEPLOY
uses: JamesIves/github-pages-deploy-action@v4
with:
FOLDER: ./doc/_build/html
CLEAN: true # Remove deleted files from the deploy branch
folder: ./doc/_build/html
clean: false # Don't remove files from other branches
dry-run: ${{ (env.IS_STAGING && 'true') || 'false' }}
4 changes: 2 additions & 2 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.11'
- name: Install dependencies
shell: bash
run: ./ci/install.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.11'
- name: Run pre-commit hooks
uses: pre-commit/[email protected]
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ docs: ## generate Sphinx HTML documentation for the current branch
$(MAKE) -C doc clean
$(MAKE) -C doc html

multidocs: ## generate Sphinx HTML documentation for the multiple versions available
$(MAKE) -C doc clean
@python scripts/tagcurrent.py -v --exclude-pattern "^\d+\.\w|(master)$$"
sphinx-multiversion doc doc/_build/html
multidocs: ## prepare Sphinx HTML documentation for multi-version deployment
mkdir doc/_build/html/5
mv doc/_build/html/* doc/_build/html/5
@python scripts/safecopy.py "5" "current" -v --base-path "doc/_build/html"
@python scripts/generateredirects.py "current" -v --base-path "doc/_build/html" --base-url "https://docs.spyder-ide.org"

Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"navigation_with_keys": False,
"show_version_warning_banner": True,
"switcher": {
"json_url": "https://docs.spyder-ide.org/versions.json",
"json_url": "https://docs.spyder-ide.org/current/_static/versions.json",
"version_match": version,
},
}
Expand Down
75 changes: 0 additions & 75 deletions scripts/tagcurrent.py

This file was deleted.

0 comments on commit cd1849c

Please sign in to comment.