Skip to content

Commit

Permalink
Fix github pages deploy
Browse files Browse the repository at this point in the history
- deploy with action artifacts, not from gh-pages branch
- check ref with master, not wiht main
  • Loading branch information
sh-cho committed Oct 31, 2023
1 parent 8ad2ed7 commit e3aac7a
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ on:
branches:
- master

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
docs:
build:
name: Build Sphinx Documentation
runs-on: ubuntu-20.04

Expand All @@ -32,10 +37,25 @@ jobs:
SYSTEM_PYTHON: python${{ matrix.python-version }}
SECRET_KEY: github-actions

- name: Deploy to GitHub Pages
if: ${{ github.ref == 'refs/heads/main' }}
uses: JamesIves/[email protected]
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: dist/html
path: 'dist/html'

deploy:
needs: build
if: ${{ github.ref == 'refs/heads/master' }}

permissions:
pages: write
id-token: write
environment:
name: production
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-20.04
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit e3aac7a

Please sign in to comment.