2024-02-16 21:48:55 +00:00
|
|
|
name: Deploy to Home Server
|
2021-10-16 08:31:21 +00:00
|
|
|
|
|
|
|
on:
|
2024-02-16 21:48:55 +00:00
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
pull_request:
|
|
|
|
branches: [master]
|
2021-10-16 08:31:21 +00:00
|
|
|
|
|
|
|
jobs:
|
2024-02-16 21:48:55 +00:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Cache Hugo resources
|
|
|
|
uses: actions/cache@v3
|
|
|
|
env:
|
|
|
|
cache-name: cache-hugo-resources
|
|
|
|
with:
|
|
|
|
path: resources
|
|
|
|
key: ${{ env.cache-name }}
|
|
|
|
|
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version: "^1.17.0"
|
|
|
|
|
|
|
|
- run: go version
|
|
|
|
|
|
|
|
- name: Setup Hugo
|
|
|
|
uses: peaceiris/actions-hugo@v2
|
|
|
|
with:
|
|
|
|
hugo-version: "latest"
|
|
|
|
extended: true
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: hugo --minify --gc
|
|
|
|
|
|
|
|
- name: Deploy 🚀
|
|
|
|
uses: easingthemes/ssh-deploy@v2
|
|
|
|
with:
|
2024-02-16 22:13:22 +00:00
|
|
|
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
|
|
|
|
REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
|
|
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
2024-02-16 21:48:55 +00:00
|
|
|
local: ./public
|
|
|
|
remote: /var/www/html/
|
|
|
|
|