Skip to content

Commit

Permalink
Update gh_pages_doc.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gschramm authored Nov 14, 2024
1 parent 729e2e0 commit 10ea5bf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/gh_pages_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ jobs:
- run: |
sphinx-multiversion docs/source _build/html
# Conditional deployment step
- name: Create 'stable' version
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
run: |
latest_tag=$(git tag --sort=-v:refname | head -n 1)
echo "Latest tag is: $latest_tag"
cp -r _build/html/$latest_tag _build/html/stable
- name: Deploy to GitHub Pages
if: github.event_name == 'push' # Only run on push to main branch, not on PRs
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 10ea5bf

Please sign in to comment.