Skip to content

Commit

Permalink
Clean up some changes, remove Glass notebook link for now, set up Plu…
Browse files Browse the repository at this point in the history
…to export workflow.
  • Loading branch information
kdpsingh committed Jan 31, 2024
1 parent 8f4d5d5 commit 9bc2846
Show file tree
Hide file tree
Showing 15 changed files with 429 additions and 2,814 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/ExportPluto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Export Pluto notebooks
on:
push:
branches:
- main
- master
workflow_dispatch:

# When two jobs run in parallel, cancel the older ones, to make sure that the website is generated from the most recent commit.
concurrency:
group: pluto-export
cancel-in-progress: true

# This action needs permission to write the exported HTML file to the gh-pages branch.
permissions:
contents: write
# (all other permission fields default to "none")

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v3

- name: Install Julia
uses: julia-actions/setup-julia@v1
with:
version: "1" # This will automatically pick the latest Julia version

- name: Cache Julia artifacts & such
uses: julia-actions/cache@v1
with:
cache-registries: "false"

# We set up a folder that Pluto can use to cache exported notebooks. If the notebook file did not change, then Pluto can take the exported file from cache instead of running the notebook.
- name: Set up notebook state cache
uses: actions/cache@v3
with:
path: pluto_state_cache
key: ${{ runner.os }}-pluto_state_cache-v2-${{ hashFiles('**/Project.toml', '**/Manifest.toml', '.github/workflows/*' ) }}-${{ hashFiles('**/*jl') }}
restore-keys: |
${{ runner.os }}-pluto_state_cache-v2-${{ hashFiles('**/Project.toml', '**/Manifest.toml', '.github/workflows/*' ) }}
- name: Run & export Pluto notebooks
run: |
julia -e 'using Pkg
Pkg.activate(mktempdir())
Pkg.add([
Pkg.PackageSpec(name="PlutoSliderServer", version="0.3.2-0.3"),
])
import PlutoSliderServer
PlutoSliderServer.github_action(".";
Export_cache_dir="pluto_state_cache",
Export_baked_notebookfile=false,
Export_baked_state=false,
# more parameters can go here
)'
- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: .
single-commit: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/.vscode/
/what-is-tidier-jl/data.zip
/data/
Loading

0 comments on commit 9bc2846

Please sign in to comment.