Skip to content

Commit

Permalink
chore: Add the Build Action
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghe-fit2cloud committed Dec 16, 2024
1 parent 0f63884 commit 3b927dc
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and deploy
on:
workflow_dispatch:
jobs:
compile-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Check
uses: actions/checkout@v4
- name: Build
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends zip
docker run --rm -v ${PWD}:/docs registry.fit2cloud.com/public/mkdocs-material:latest build
zip -r -q -9 site.zip site
ls -la site.zip
- name: Upload
uses: appleboy/[email protected]
with:
host: ${{ secrets.PANEL_CN_HOST }}
username: ${{ secrets.PANEL_CN_HOST_USERNAME }}
port: 22
key: ${{ secrets.PANEL_CN_HOST_KEY }}
source: "site.zip"
target: /tmp
- name: Deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.PANEL_CN_HOST }}
username: ${{ secrets.PANEL_CN_HOST_USERNAME }}
key: ${{ secrets.PANEL_CN_HOST_KEY }}
port: 22
script: |
cd /tmp
rm -rf site
unzip site.zip
rm -rf /opt/1panel/docs/*
mv /tmp/site/* /opt/1panel/docs
/opt/nginx/bin/reload-nginx.sh
rm -rf /tmp/site*

0 comments on commit 3b927dc

Please sign in to comment.