-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (32 loc) · 954 Bytes
/
deploy.yml
File metadata and controls
37 lines (32 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.131.0'
- name: Build
run: hugo --minify
- name: copy files via ssh
run: |
set -x
mkdir -p ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/id_rsa
touch ~/.ssh/known_hosts
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/known_hosts
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} mkdir -p ${{ secrets.SSH_DIR }}
rsync -avz --del ./public/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.SSH_DIR }}