54 points · by linsomniac · 1y ago · 19 comments
Probably not a problem unless you work with others or have a tendency to push commits fast/have a slow pipeline (building WASM from Rust is really slow), but it seems you're missing to limit the concurrency, which can lead to old commit being deployed over a newer commit, depending on which finishes first.
Also limiting it to your main/master branch makes sense in case you use branches, otherwise WIP branches might deploy over your "production" one :)
One final word of advice, try to do as little as possible in the .yml configuration itself (I see Simon is "emulating" the build process inside of the CI config), as testing changes becomes a huge hassle otherwise. Instead, extract it into a shell-script/Makefile/Justfile or something, then call that from your CI config, so you can also run the same code locally.
My https://tools.simonwillison.net/colophon page is a good example of that.
Here[1] I keep docs about the truck camper I'm building. I use one GHA[2] to generate the TOC, and another GHA[3] to run make in the root directory and then commit and push modified files (to a PR branch). The make process uses scripts to generate new Markdown pages based on a template, auto-generating Markdown tables from CSV files and inserting them into the final Markdown.
By keeping this all as a GHA, I don't have to do anything manual to generate the new site. I just open a PR with my new content and the actions fix up everything. It's basically a janky static site editor but using simpler tools I'm familiar with and can customize easier.
I've been wanting to host it as GH Pages but haven't gotten around to it. Partly I need to do this because my 3d models run into GitHub's LFS bandwidth limits and hopefully Pages won't (if I do run into Pages' bandwidth limit, I'll need to find some other cheap hosting, or not share my models anymore =/ )
[1] https://github.com/peterwwillis/truckcamper [2] https://github.com/peterwwillis/truckcamper/blob/main/.githu... [3] https://github.com/peterwwillis/truckcamper/blob/main/.githu...
GitHub Actions is just great, and I think people overlook again how much you can do for free! As the author highlights, I use it for running workflows on a schedule, which you can use to rebuild static sites hourly, so they aren't so static after all.
Looks like Simon and I were working on very similar things simultaneously.
GitHub has package repos; "GitHub Packages" for a few package formats, and OCI artifacts. https://docs.github.com/en/packages/working-with-a-github-pa...
OCI Artifacts with labels include signed Container images and signed Packages.
Packages can be hosted as OCI image repository artifacts with signatures; but package managers don't natively support OCI image stores, though many can install packages hosted at GitHub Packages URLs which are referenced by a signed package repository Manifest on a GitHub Pages or GitLab Pages site (e.g. with CF DNS and/or CloudFlare Pages in front)
I get it, but verifying checksums of downloads via https from github releases, downloaded across github's architecture (admittedly Azure) to githubs's runners seems like overkill. Especially as I don't see any signatures of the checksums, so the checksums are being retrieved via that same infrastructure with the same security guarantees. What am I missing?
.deb and .rpm Package managers typically reference a .tar.gz with a checksum; commit that to git signed with a GPG key; and then the package is signed by a (reproducible) CI build with the signing key for that repo's packages.
conda-forge can automatically send a Pull Request to update the upstream archive URL and cached checksum in the package manifest when there is a new upstream package.
I spent a while exploring how index pages a few years ago and figured out the rules: https://til.simonwillison.net/github/github-pages#user-conte...