Have a github action to compile and publish a presentation on github pages
Taking inspiration from https://github.com/ralexander-phi/marp-to-pages. Thanks 8organicbits for the idea!
To be honest that looks over-engineered...
Yes, you're right.
I think that GH actions are not for writing your presentation -- you need a "live-previewing" to make the experience nice. So a GH action would only be useful as a way to host your presentation. I think there are several ways to do this:
- Have a section in the docs with a copy-pastable bit of yaml, to copy in a workflow file, that installs slipshow, compiles the presentation, and commits the result in the gh-pages
- Release a github action in the marketplace that does this, and have a section in the docs with a copy-pastable, much smaller, bit of yaml that uses it.
I think the most value-added part of this issue is to have a way to distribute a slipshow binary for use from GitHub actions. opam install slipshow takes a lot of time as it needs to compile from sources the whole dependency cone.
Edited: the difference between the options you mention is rather small, and orthogonal to whether slipshow is installed from a binary or from sources with transitively from-source installed dependencies.
I think the most value-added part of this issue is to have a way to distribute a slipshow binary for use from GitHub actions.
In another project I used docker (just like in the example linked above), that's not ideal (the docker image needs to be maintained). Another way is to download the latest github release of slipshow (it contains precompiled binaries), and use that. Or, as you said use opam, but that uses a lot of compute power and time... (and I'm not sure how caching would work, wrt new slipshow versions?)
Edited: the difference between the options you mention is rather small, and orthogonal to whether slipshow is installed from a binary or from sources with transitively from-source installed dependencies.
Yes.
Another way is to download the latest github release of slipshow (it contains precompiled binaries), and use that.
That sounds best in terms of "doing the right thing" except I don't know how easy it is to write the yaml.
This works great for me:
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@main
- name: Install slipshow
run: |
wget https://github.com/panglesd/slipshow/releases/download/v0.6.0/slipshow-linux-x86_64.tar
tar -xvf slipshow-linux-x86_64.tar --strip-components=1
sudo mv slipshow /usr/local/bin/slipshow
- name: My slides
run: slipshow compile docs/my-slides.md -o docs/html/my-slides.html
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/html/
destination_dir: docs
enable_jekyll: true
The downside is slipshow version is hardcoded (needs manual update to latest).
Thanks a lot!! I'll add that to the docs/a github action, at some point, if you allow me!
Of course, I'd be honored. Do note that the Deploy section uses the old-school gh-pages branch approach, I don't remember what's the current recommended approach.