GH-Action: GLMakie needs add xvfb-run (#12) #46
This file contains 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
### | |
# HELLO | |
# Interested in setting up a cool github action like this one? Take a look at: https://github.com/JuliaPluto/static-export-template | |
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 | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Julia | |
uses: julia-actions/setup-julia@v1 | |
with: | |
# note: this version should match the version in the other actions in this repo | |
version: "1.6" | |
- name: Cache Julia artifacts & such | |
uses: julia-actions/cache@v1 | |
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@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: | | |
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia -e ' | |
import Pkg | |
Pkg.activate("pluto-deployment-environment") | |
Pkg.instantiate() | |
import PlutoSliderServer | |
isdir("output") && rm("output"; recursive=true) | |
PlutoSliderServer.github_action("src"; | |
Export_output_dir="output", | |
Export_cache_dir="pluto_state_cache", | |
# more parameters can go here | |
)' | |
- name: Deploy to dist | |
uses: JamesIves/github-pages-deploy-action@releases/v4 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: dist | |
FOLDER: output |