@@ -1,40 +1,22 @@
|
||||
name: Build Hugo Site
|
||||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
container:
|
||||
image: hugomods/hugo:debian-nightly
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install deploy deps
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y rsync openssh-client
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Build
|
||||
run: hugo --minify
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
mkdir -p /root/.ssh
|
||||
echo "$SSH_KEY" > /root/.ssh/id_ed25519
|
||||
chmod 600 /root/.ssh/id_ed25519
|
||||
rsync -avz --delete \
|
||||
-e "ssh -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=no" \
|
||||
public/ ${SSH_USER}@${SSH_HOST}:${DEPLOY_PATH}
|
||||
env:
|
||||
SSH_KEY: ${{ secrets.SSH_KEY }}
|
||||
SSH_USER: ${{ secrets.SSH_USER }}
|
||||
SSH_HOST: ${{ secrets.SSH_HOST }}
|
||||
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
|
||||
|
||||
rm -rf /web/personal/*
|
||||
cp -r public/* /web/personal/
|
||||
|
||||
3
content/_index.md
Normal file
3
content/_index.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Hello
|
||||
|
||||
This is my site.
|
||||
3
hugo.toml
Normal file
3
hugo.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
baseURL = "https://caio.wakamatsu.cc"
|
||||
languageCode = "en-us"
|
||||
title = "Caio's Corner"
|
||||
9
layouts/index.html
Normal file
9
layouts/index.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ .Site.Title }}</title>
|
||||
</head>
|
||||
<body>
|
||||
{{ .Content }}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user