2024-01-10 15:24:17 +00:00
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
2024-01-15 19:44:39 +00:00
|
|
|
runs-on: docker
|
2024-01-10 15:24:17 +00:00
|
|
|
container:
|
2024-01-10 15:48:42 +00:00
|
|
|
image: ghcr.io/peaceiris/hugo:latest-full
|
2024-01-10 15:24:17 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-01-10 16:11:24 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y rsync
|
2024-01-10 15:28:57 +00:00
|
|
|
|
2024-01-10 15:24:17 +00:00
|
|
|
- name: Setup Hugo
|
|
|
|
uses: https://github.com/peaceiris/actions-hugo@v2
|
|
|
|
with:
|
|
|
|
hugo-version: 'latest'
|
|
|
|
extended: true
|
|
|
|
|
|
|
|
- name: Build Hugo Site
|
|
|
|
run: hugo
|
|
|
|
|
2024-01-10 20:33:21 +00:00
|
|
|
- name: Prepare Deployment
|
|
|
|
run: |
|
|
|
|
mv public/* .
|
|
|
|
rmdir public
|
|
|
|
|
2024-01-10 16:31:11 +00:00
|
|
|
- name: Deploy to Host
|
2024-01-10 20:15:26 +00:00
|
|
|
uses: https://github.com/appleboy/scp-action@v0.1.7
|
2024-01-10 16:31:11 +00:00
|
|
|
with:
|
2024-01-10 20:15:26 +00:00
|
|
|
host: ${{ secrets.SSH_HOST }}
|
|
|
|
username: ${{ secrets.SSH_USERNAME }}
|
|
|
|
key: ${{ secrets.SSH_PRIV_KEY }}
|
|
|
|
passphrase: ${{ secrets.SSH_PASSPHRASE }}
|
|
|
|
port: ${{ secrets.SSH_PORT }}
|
2024-01-10 20:33:21 +00:00
|
|
|
source: .
|
2024-01-10 20:15:26 +00:00
|
|
|
target: "/var/www/wiki.lunivity.com/"
|
2024-02-15 08:52:25 +00:00
|
|
|
rm: true
|