Brackets
Oct 5, 2019
Tags:
XKCD
I missed the first two matches, but I’m in for the rest. If I’m right, I think Volcano Vs. Predator and Octopus Vs. Zombies will be the closest matches of the tournament. But who knows what will happen—any given Sunday and all that.
Github Actions V2: Build and Deploy Jekyll
Oct 5, 2019
Tags:
Jekyll Web Development GitHub Actions
Late last year—after I got my invitation into the beta of Github Actions—I wrote up a quick little action and workflow for building and deploying a Jekyll repo back to its gh-pages branch. Mostly I just wanted to see how actions worked. But, this was also a nice way to build a Jekyll site with my own custom gems and buildscripts while still keeping the enitre workflow on Github—which is my preference.
Well…when Github said beta, they meant beta. In August they overhauled the Actions API taking it to, what I suppose was alwyays its logical conclusion, a fully fledged continuous integration/continuous deployment service. Support for actions and workflows written against the old API ended last week. So…I’ve re-written my simple little action for the new API.
Keep in mind that as Github says: ‘GitHub Actions is currently in limited public beta and is subject to change.’ I imagine things will still change quite a bit. The GITHUB_TOKEN
for instance—an auth token scoped to the repository, for doing things like pushing changes to the repo using the workflow—has limited ability to initiate builds on Github Pages (unless it’s being used in a workflow in a private repository), which doesn’t really make any sense when you think about it. But, they’re working on it.
Dry The Rain
Dec 16, 2018
Tags:
Music
“I will now sell five copies of The Three EP’s by The Beta Band”.
My Favorite Things
Dec 16, 2018
Tags:
Music
Do yourself a favor this year. Skip the clichéd Mariah Carey remakes. Throw those awful Michael Bublé CD’s in the trash. Avoid the whole “Baby it’s Cold Outsite” drama. Just listen to this.
Wikipedia explains:
The famous track is a modal rendition of the Rodgers and Hammerstein song “My Favorite Things” from The Sound of Music. The melody is heard numerous times throughout, but instead of playing solos over the written chord changes, both Tyner and Coltrane take extended solos over vamps of the two tonic chords, E minor and E major, played in waltz time.
This track exists as a life affirming oasis amid the neverending desert of holiday muzack being piped into every square inch of the public commons this time of year. Coltrane offers an existential escape—a brief respite from the soul crushing weight of those consumer-driven cultural expectations that we call The Holidays.
Be kind to yourself—play it on repeat—breathe. Merry Christmas.
Using GitHub Actions to Deploy your Jekyll Site
Dec 1, 2018
Tags:
Jekyll Web Development GitHub Actions
UPDATE: Github Actions API has been updated, See here for an updated version of what’s discussed below
A few weeks ago, I got invited into the limited beta for GitHub Actions. In case you’ve not heard of Actions before—it’s GitHub’s pitch for the future of continuous integration/deployment of GitHub repos. As has been said:
The future has arrived, it’s just not evenly distributed yet. –Apocryphal William Gibson
Is Actions the future? I don’t know, but after playing with the beta for a bit—I do think it’s pretty cool. Even for something relatively straightforward like building a Jekyll site—the immediate advanages are obvious.
- Want to use those custom Jekyll plugins that GitHub Pages has always blocked? No problem.
- Want to update your search index with newly built pages everytime you deploy? Sure thing.
- Want to run some NPM scripts to compress, concatenate, autoprefix, ship, resize, slice, or dice any, some, or all of your assets? Errr…OK.
- Want to do it all while staying on GitHub…for free? Let’s do this.
Setting Up Your Workflow
Once we have access to Actions we can start things off by adding a do-stuff.workflow
file in a .github
directory sitting in the root of our repository. Github includes a little visual editor you can use to setup your workflow, but I found this to be more trouble than it was worth. Essentially: our workflow needs to identify itself, indicate a trigger, point to an action, and include any secrets or environment variables the action will need.
workflow "Deploy Site" {
on = "push"
resolves = ["Build and Deploy Jekyll"]
}
action "Build and Deploy Jekyll" {
uses = "BryanSchuetz/jekyll-deploy-gh-pages@master"
secrets = ["GITHUB_TOKEN"]
}
Building the Action
In the action directory we need a couple things:
Dockerfile
We’ll use Docker to setup a container within which we can import ruby and jekyll and any other gems we’ll need to build our site.Entrypoint.sh
This is where the heart of our action lives. We’ll install all our Gem dependencies, build the site, initialize and setup Git, and then push all the site files back to the gh-pages branch of our repo.README.md
Explain what the action does. One of the nicer features of Actions is that creators can expose them in a public repo—so that other users can call them from their own workflows!
Try it Out
As mentioned above, I’ve put this action in its own public repository so anyone can point to it and use it to build and deploy their own Jekyll site. Or, just have a look around and see how I’ve sructured things—I’m sure there are efficiences I could make—if you have any suggestions, please let me know.