name: Deploy Hugo Site

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: self-hosted
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: '0.147'  # specify your Hugo version

      - name: Build Hugo site
        run: hugo --destination /home/pim/website-live

      - name: Sync to live
        run: rsync -av --delete ./public/ /home/pim/website-live/
