forked from sinamics/ztnet
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.2 KB
/
docs-build-runner.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Deploy Docusaurus on runner agent
on:
push:
branches:
- main
paths:
- "docs/**"
workflow_dispatch:
jobs:
build:
runs-on: [self-hosted, ztnet.network]
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: Install dependencies
run: npm install
- name: Install Tailwind CSS
run: npm install tailwindcss
- name: Build API docs
run: npx docusaurus gen-api-docs all
- name: Build website
run: npm run build
deploy:
runs-on: [self-hosted, ztnet.network]
defaults:
run:
working-directory: docs
needs: build
steps:
- name: Move Website to Temporary Directory
run: |
# Define a directory within the user's home for the build
BUILD_DIR=~/ztnet_docs
# Remove any existing build directory
rm -rf $BUILD_DIR
# Create a new build directory
mkdir -p $BUILD_DIR
# Move the new build to the directory
mv build $BUILD_DIR
- name: Restart Server
run: pm2 restart ecosystem.config.js