Skip to content

Commit

Permalink
use actions to publish pages
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeegan committed May 15, 2024
1 parent 963f2e5 commit e2ad823
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,25 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
- run: pip install -r requirements.txt
- run: sudo apt update -qy && sudo apt install ffmpeg -qy
- run: jupyter nbconvert *.ipynb --to slides --execute
- run: mkdir dist && mv *.slides.html dist/index.html
- uses: JamesIves/github-pages-deploy-action@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Deploy to gh-pages
- uses: actions/upload-pages-artifact@v3
with:
branch: gh-pages
folder: dist
single-commit: true
path: "dist/"

deploy:
if: github.ref == 'refs/heads/main'
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/deploy-pages@v4
id: deployment
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -9,7 +9,7 @@ repos:
- id: check-toml

- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.2
hooks:
- id: black
- id: black-jupyter
Expand All @@ -28,7 +28,7 @@ repos:
- "prettier-plugin-toml"

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.1
rev: 0.28.3
hooks:
- id: check-github-workflows

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The notebook [jupyter-slides-template.ipynb](jupyter-slides-template.ipynb) is c
## Quickstart

- click the [Use this template](https://github.com/ssciwr/jupyter-slides-template/generate) button to create your own repo based on this one
- enable gh-pages for your repo: Settings -> Pages -> Source branch: gh-pages
- enable gh-pages for your repo: Settings -> Pages -> Source: `GitHub Actions`
- slides will appear at `YOUR_USERNAME.github.io/YOUR_REPO_NAME`

## Optional extras
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
jupyter
rise

# The following packages are only required for the example
# notebook. You should replace them with the dependencies
Expand Down

0 comments on commit e2ad823

Please # to comment.