slipshow icon indicating copy to clipboard operation
slipshow copied to clipboard

Have a github action to compile and publish a presentation on github pages

Open panglesd opened this issue 1 year ago • 8 comments

Taking inspiration from https://github.com/ralexander-phi/marp-to-pages. Thanks 8organicbits for the idea!

panglesd avatar May 29 '24 14:05 panglesd

To be honest that looks over-engineered...

lukstafi avatar Aug 30 '25 15:08 lukstafi

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.

panglesd avatar Aug 31 '25 20:08 panglesd

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.

lukstafi avatar Aug 31 '25 20:08 lukstafi

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.

panglesd avatar Aug 31 '25 20:08 panglesd

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.

lukstafi avatar Aug 31 '25 21:08 lukstafi

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).

lukstafi avatar Sep 06 '25 13:09 lukstafi

Thanks a lot!! I'll add that to the docs/a github action, at some point, if you allow me!

panglesd avatar Sep 10 '25 07:09 panglesd

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.

lukstafi avatar Sep 10 '25 07:09 lukstafi