Skip to content

Commit

Permalink
Use modern website workflow with up to date sphinx version
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-ballarin committed Nov 25, 2023
1 parent ca80305 commit e76a07b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 31 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,39 @@ jobs:
website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate sphinx website
uses: ax3l/sphinx-action@newer-sphinx
- name: Clone website repository on current branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Clone website repository on gh-pages branch
uses: actions/checkout@v4
with:
pre-build-command: "pip3 -q install sphinx-material 'sphinxcontrib-bibtex<2.0.0'"
docs-folder: .
ref: gh-pages
fetch-depth: 0
path: _build/html
- name: Install dependencies
run: |
pip3 -q install sphinx-material sphinxcontrib-bibtex
- name: Generate sphinx website
run: |
rm -rf _build/html/* && python3 -m sphinx -W -b html . _build/html
- name: Fix permissions and add CNAME file
run: |
sudo chown $USER _build -R
echo "www.rbnicsproject.org" > _build/html/CNAME
- name: Deploy to GitHub pages
if: github.repository == 'RBniCS/rbnicsproject.org' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/html
user_name: 'GitHub Actions'
user_email: '41898282+github-actions[bot]@users.noreply.github.com'
run: |
SHA_SHORT=$(git rev-parse --short HEAD)
pushd _build/html
git config user.name "GitHub Actions"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git pull origin gh-pages
[ -n "$(git status --porcelain=v1 2>/dev/null)" ] && git commit -m "deploy: ${SHA_SHORT}"
git push origin gh-pages
popd
shell: bash
- name: Deploy to GitHub artifacts
if: github.repository == 'RBniCS/rbnicsproject.org' && github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
Expand Down
20 changes: 0 additions & 20 deletions Makefile

This file was deleted.

0 comments on commit e76a07b

Please sign in to comment.