Skip to content

Commit

Permalink
Improve deploy of docs in gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
pablormier committed May 9, 2024
1 parent efc2e3c commit 6b8cd8b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensures all history is fetched for sphinx-multiversion to detect all tags and branches
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.11'

Expand All @@ -45,8 +45,23 @@ jobs:
git config --local user.name "GitHub Action"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
keep_files: false
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git fetch origin gh-pages
git checkout gh-pages || git checkout --orphan gh-pages
# Get the name of the branch that triggered the workflow
BRANCH_NAME=${GITHUB_REF#refs/heads/}
echo "Deploying documentation for branch: $BRANCH_NAME"
# Removing old files
rm -rf "./$BRANCH_NAME"
mkdir -p "./$BRANCH_NAME"

# Copying new files
cp -r "docs/_build/html/$BRANCH_NAME/." "./$BRANCH_NAME/"

# Adding changes to git
git add .
git commit -m "Update docs for branch $BRANCH_NAME"
git push -u origin gh-pages
2 changes: 1 addition & 1 deletion corneto/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _get_info() -> Dict[str, Dict]:
"value": available_backends(),
}
info["default_backend"] = {
"title": "Default backend (corneto.K)",
"title": "Default backend (corneto.opt)",
"message": "No backend detected, please install CVXPY or PICOS",
"value": None,
}
Expand Down

0 comments on commit 6b8cd8b

Please sign in to comment.