45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: Build Hugo Site
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Install Hugo
|
|
uses: peaceiris/actions-hugo@v2
|
|
with:
|
|
hugo-version: 'latest'
|
|
extended: true
|
|
|
|
- name: Build Site
|
|
run: hugo --minify
|
|
|
|
- name: Test SSH Connection
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
# Add verbose output and show the SSH version
|
|
ssh -V
|
|
ssh -vvv -o StrictHostKeyChecking=no john@192.168.1.177 'echo "Connection successful"'
|
|
|
|
- name: Deploy to Server
|
|
uses: appleboy/scp-action@v0.1.7
|
|
with:
|
|
host: "192.168.1.177"
|
|
username: "john"
|
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
source: "public/*"
|
|
target: "/home/john/mine/scripts/hugo/"
|
|
strip_components: 1
|
|
debug: true |