Skip to content

Commit 3b927dc

Browse files
chore: Add the Build Action
1 parent 0f63884 commit 3b927dc

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and deploy
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
compile-and-deploy:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Check
9+
uses: actions/checkout@v4
10+
- name: Build
11+
run: |
12+
sudo apt-get update
13+
sudo apt-get install -y --no-install-recommends zip
14+
docker run --rm -v ${PWD}:/docs registry.fit2cloud.com/public/mkdocs-material:latest build
15+
zip -r -q -9 site.zip site
16+
ls -la site.zip
17+
- name: Upload
18+
uses: appleboy/[email protected]
19+
with:
20+
host: ${{ secrets.PANEL_CN_HOST }}
21+
username: ${{ secrets.PANEL_CN_HOST_USERNAME }}
22+
port: 22
23+
key: ${{ secrets.PANEL_CN_HOST_KEY }}
24+
source: "site.zip"
25+
target: /tmp
26+
- name: Deploy
27+
uses: appleboy/[email protected]
28+
with:
29+
host: ${{ secrets.PANEL_CN_HOST }}
30+
username: ${{ secrets.PANEL_CN_HOST_USERNAME }}
31+
key: ${{ secrets.PANEL_CN_HOST_KEY }}
32+
port: 22
33+
script: |
34+
cd /tmp
35+
rm -rf site
36+
unzip site.zip
37+
rm -rf /opt/1panel/docs/*
38+
mv /tmp/site/* /opt/1panel/docs
39+
/opt/nginx/bin/reload-nginx.sh
40+
rm -rf /tmp/site*

0 commit comments

Comments
 (0)