Skip to content

Commit

Permalink
.github/workflows/sphinx: Bugfixes from git-intro
Browse files Browse the repository at this point in the history
  • Loading branch information
rkdarst committed Sep 13, 2023
1 parent 13f081c commit 5044dbc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ env:
# builds and fail on any warnings.
#SPHINXOPTS: "-W --keep-going -T"
GENERATE_PDF: true # to enable, must be 'true' lowercase
MULTIBRANCH: true # same
PDF_FILENAME: lesson.pdf
MULTIBRANCH: true # to enable, must be 'true' lowercase


jobs:
Expand Down Expand Up @@ -91,7 +92,7 @@ jobs:
run: |
pip install https://github.com/rkdarst/sphinx_pyppeteer_builder/archive/refs/heads/main.zip
make pyppeteer
mv _build/pyppeteer/*.pdf _build/dirhtml/_static/lesson.pdf
mv _build/pyppeteer/*.pdf _build/dirhtml/_static/${PDF_FILENAME}.pdf
# Stage all deployed assets in _gh-pages/ for simplicity, and to
# prepare to do a multi-branch deployment.
Expand Down Expand Up @@ -119,6 +120,7 @@ jobs:
# Save artifact for the next step.
- uses: actions/upload-artifact@master
if: ${{ github.event_name == 'push' }}
with:
name: gh-pages-build
path: _gh-pages/
Expand All @@ -129,11 +131,14 @@ jobs:
name: Deploy
runs-on: ubuntu-latest
needs: build
# This if can't use the env context - find better way later.
if: ${{ github.event_name == 'push' }}
permissions:
contents: write

steps:
- uses: actions/download-artifact@v3
if: ${{ github.event_name == 'push' && ( env.MULTIBRANCH == 'true' || github.ref == format('refs/heads/{0}', env.DEFAULT_BRANCH )) }}
with:
name: gh-pages-build
path: _gh-pages/
Expand All @@ -147,8 +152,7 @@ jobs:
# https://github.com/peaceiris/actions-gh-pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' }}
#if: ${{ success() && github.event_name == 'push' && github.ref == 'refs/heads/$DEFAULT_BRANCH' }}
if: ${{ github.event_name == 'push' && ( env.MULTIBRANCH == 'true' || github.ref == format('refs/heads/{0}', env.DEFAULT_BRANCH )) }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 5044dbc

Please sign in to comment.