Adventures in Labbing: Part 4 - Github Actions – Idiot Wizard of the Internet

Adventures in Labbing: Part 4 - Github Actions


It’s working! I set up a self-hosted action runner on one of the scrappernetes nodes and made it run as a service. This allowed me to start building out steps using the doctl tools after I was able to install that on the node as well.

This was pretty easy with the Actions Runner documentation.

# Create a folder
$ mkdir actions-runner && cd actions-runner
# Download the latest runner package
$ curl -o actions-runner-linux-x64-2.301.1.tar.gz -L
# Optional: Validate the hash
$ echo "3ee9c3b83de642f919912e0594ee2601835518827da785d034c1163f8efdf907  actions-runner-linux-x64-2.301.1.tar.gz" | shasum -a 256 -c
# Extract the installer
$ tar xzf ./actions-runner-linux-x64-2.301.1.tar.gz
# Create the runner and start the configuration experience
$ ./ --url --token fubar
# Create a service.
$ ./ install
# Last step, run it!
$ ./ start

From there it was just a matter of making sure runs-on: self-hosted is in my workflow, which coincidentally looks like this.

name: Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

    branches: [ "main" ]
    branches: [ "main" ]

  # Use for Docker Hub if empty

  # github.repository as <account>/<repo>


    runs-on: self-hosted
      contents: read
      packages: write
      # This is used to complete the identity challenge
      # with sigstore/fulcio when running outside of PRs.
      id-token: write

      - name: Checkout Repo
        uses: actions/checkout@v3
          repository: foo/bar
          token: ${{ secrets.GH_TOKEN }}
          ref: main

      - name: DigitalOcean Docker Image Publish
        uses: ripplr-io/docr-docker-publish@v1
          image_path: foo/bar

      # Set up the Kubernetes CLI with your DigitalOcean Kubernetes cluster.
      - name: Set up kubectl
        uses: matootie/dokube@v1.4.0
          personalAccessToken: ${{ secrets.DO_TOKEN }}
          clusterName: ward-personal-sandbox

      # Run any kubectl commands you want!
      - name: Rollout Pods
        run: kubectl rollout restart deploy -n blog blog 

This makes building and deploying the blog a breeze. I even included a quick Github trigger in n8n so it knows when I’ve pushed a new blog post and makes a Toot promoting it with a small snippet of text from the top of the post. Here’s what that looks like now.

Mastodon Post Workflow

I’m exited to maybe get a couple posts done while on the road. The best thing to do might be to make a bunch of branches with pre-formatted posts ready to go so I can edit them on mobile and PR them in.

I’m just happy it’s up and working! I think I’ll get everything ready for the trip now.

Enter your instance's address