-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.05 KB
/
hexo_auto_deploy.yaml
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
38
39
40
41
name: Hexo automatic deployment
on:
push:
branches:
- main
jobs:
hexo_deploy:
name: Hexo automatic deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3
with:
node-version: 20.17.0
- name: Install Node.js Package
run: |
npm -g install yarn
yarn install
- name: LXD deployment environment initialization
run: |
sudo snap install lxd
sudo lxd init --auto
sudo lxc remote add deploy direct.qhjack.top --password ${{secrets.LXD_PASSWORD}} --accept-certificate
sudo lxc remote switch deploy
- name: Hexo Deploy
run: |
yarn global add hexo
hexo clean
hexo generate
- name: clear LXD cache
run: |
sudo lxc exec qhjack /usr/bin/clean_qhjack_web.fish
- name: baidu verfiy
run: |
cp -rfv static/* public
- name: Upload files to LXD on direct.qhjack.top
run: |
cp -r public qhjack
sudo lxc file push -p -r qhjack qhjack/var/www/