Dieser Blog wird mit hilfe von Hugo erstellt. Hugo ist ein Static-Side-Generator der Markdown in HTML übersetzt und mit Plugins und Themes versieht. Da ich die Seite nicht immer manuell updaten möchte, habe ich eine Github Action eingerichtet, die die Statische Seite automatisch erstellt und auf den Server kopiert.

Der Github Workflow (.github/workflows/deploy.yml) sieht dabei wie folgt aus:

name: Publish

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  deploy:
    runs-on: ubuntu-22.04
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: true # Fetch Hugo themes (true OR recursive)
          fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

      - name: Read .env
        id: hugo-version
        run: |
          . ./.env
          echo "::set-output name=HUGO_VERSION::${HUGO_VERSION}"          

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: "${{ steps.hugo-version.outputs.HUGO_VERSION }}"
          extended: true

      - name: Build
        run: hugo --minify

      - name: rsync deployments
        uses: burnett01/rsync-deployments@5.2.1
        with:
          switches: -avzr --delete
          path: public/
          remote_path: /path/to/httpdata
          remote_host: tieben.biz
          remote_user: username
          remote_key: ${{ secrets.SSH_PRIVATE_KEY }}