↓ Skip to main content
  1. Posts/

Go with the workflow!

·242 words·2 mins
Table of Contents

Workflow?
#

A good year ago, I wrote that the site had finally moved to a new platform, but that there were still some gains to be made. Rendering and uploading the site was still a manual action. That actually worked fine, but still. Today, I was actually planning to work on two trip reports. But instead I thought, let me finally get that last loose end out of the way.

Workflow!
#

And so there is now finally a GitHub Workflow that does everything for me. It took a bit of fiddling, given that the web host doesn’t support everything all that well. But from now on, all it takes is a simple commit to the main branch, and not long after, the updated site is online. It can surely still be improved, but for now the workflow below will do. And now on to the trip reports…

name: Build and Deploy
on:
    workflow_dispatch:
    push:
        branches:
            - main

jobs:
    build:
        name: Build & Deply
        runs-on: ubuntu-latest
        steps:
            - name: Checkout
              uses: actions/checkout@v4

            - name: Setup Hugo
              uses: peaceiris/actions-hugo@v2
              with:
                hugo-version: "latest"
                extended: true

            - name : Download blowfish-theme
              run: git submodule update --init --recursive
            
            - name: Build Site
              run: hugo --gc --minify

            - name: Deploy Site
              uses: haukurh/lftp-action@v1
              with:
                # SFTP credentials
                ftp_host: ${{ secrets.SFTP_HOST }}
                ftp_user: ${{ secrets.SFTP_USER }}
                ftp_pass: ${{ secrets.SFTP_PASS }}
                ftp_port: ${{ secrets.SFTP_PORT }}
                disable_strict_host_key_checking: "true"
                # LFTP settings
                commands: mirror --continue --reverse --delete --verbose source target