This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
name: Deploy to Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup SSH key
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
ssh-keyscan -H micecola.top >> ~/.ssh/known_hosts
|
||||||
|
env:
|
||||||
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Create remote directory
|
||||||
|
run: |
|
||||||
|
ssh kb_admin@micecola.top "mkdir -p /www/wwwroot/kb-web-test/zhangqing"
|
||||||
|
|
||||||
|
- name: Deploy to server
|
||||||
|
run: |
|
||||||
|
rsync -avz --delete \
|
||||||
|
--exclude='.git' \
|
||||||
|
--exclude='.gitea' \
|
||||||
|
--exclude='*.pyc' \
|
||||||
|
--exclude='__pycache__' \
|
||||||
|
./ kb_admin@micecola.top:/www/wwwroot/kb-web-test/zhangqing/
|
||||||
Reference in New Issue
Block a user