From 083b431d65f396151bc72e40224b0d83fa6d5d89 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Fri, 17 Dec 2021 23:35:30 +0100 Subject: [PATCH] Create ExportPluto.yml --- .github/workflows/ExportPluto.yml | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ExportPluto.yml diff --git a/.github/workflows/ExportPluto.yml b/.github/workflows/ExportPluto.yml new file mode 100644 index 00000000..6b1d64c8 --- /dev/null +++ b/.github/workflows/ExportPluto.yml @@ -0,0 +1,56 @@ +name: Export Pluto notebooks +on: + push: + branches: + - main + - master + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + + - name: Install Julia + uses: julia-actions/setup-julia@v1 + with: + version: 1.7 + + + # 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@v2 + 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/v3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: notebook-exports + FOLDER: .