PersonalSite/.gitea/workflows/hugo-deploy.yaml

34 lines
952 B
YAML
Raw Normal View History

2024-06-27 23:50:38 +01:00
name: Hugo Deploy Pipeline
run-name: Builds the Hugo site and Deploys via SSH to the Server
2024-06-28 11:08:57 +01:00
on:
push:
branches:
- main
2024-06-27 22:56:36 +01:00
jobs:
2024-06-27 23:24:15 +01:00
Build-and-Deploy:
2024-06-27 22:56:36 +01:00
runs-on: ubuntu-latest
steps:
2024-06-27 23:24:15 +01:00
- uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.128.0'
- name: Build
2024-06-27 23:34:45 +01:00
run: hugo --minify
- name: Deploy to Staging server
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-rlgoDzvc -i"
SOURCE: "public/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}
2024-06-28 16:59:18 +01:00
EXCLUDE: "/dist/, /node_modules/"