@@ -1,40 +1,22 @@
|
|||||||
name: Build Hugo Site
|
name: Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
deploy:
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: hugomods/hugo:debian-nightly
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Install deploy deps
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y rsync openssh-client
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: hugo --minify
|
uses: peaceiris/actions-hugo@v2
|
||||||
|
with:
|
||||||
|
hugo-version: 'latest'
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /root/.ssh
|
rm -rf /web/personal/*
|
||||||
echo "$SSH_KEY" > /root/.ssh/id_ed25519
|
cp -r public/* /web/personal/
|
||||||
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 }}
|
|
||||||
|
|
||||||
|
|||||||
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