Bump julia-actions/cache from 2 to 3 #73
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Export Pluto notebooks | |
| on: | |
| push: | |
| branches: ['main'] | |
| 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 | |
| jobs: | |
| build-and-deploy: | |
| name: Build and deploy Pluto.jl notebooks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout this repository | |
| uses: actions/checkout@v6 | |
| - name: Install Julia | |
| uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: '1' | |
| show-versioninfo: true | |
| - name: Cache Julia artifacts & such | |
| uses: julia-actions/cache@v3 | |
| with: | |
| cache-registries: "true" | |
| # 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@v5 | |
| 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: Install DrWatson.jl and PlutoSliderServer.jl in runner environment | |
| shell: julia --color=yes {0} | |
| run: using Pkg; Pkg.add(["DrWatson","PlutoSliderServer"]); | |
| - name: Instantiate shared notebook environment | |
| shell: julia --color=yes --project {0} | |
| run: using Pkg; Pkg.instantiate(); | |
| - name: Run & export Pluto notebooks | |
| shell: julia --color=yes {0} | |
| run: | | |
| import PlutoSliderServer | |
| PlutoSliderServer.github_action( | |
| "notebooks"; | |
| Export_output_dir="notebooks", | |
| Export_cache_dir="pluto_state_cache", | |
| Export_baked_notebookfile=false, | |
| Export_baked_state=false, | |
| ) | |
| - 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 |