mirror of
https://github.com/woodchen-ink/Random-Api.git
synced 2025-07-18 05:52:02 +08:00
取消自动部署
This commit is contained in:
parent
fe40f62c46
commit
43bc465cf7
55
.github/workflows/deploy.yml
vendored
55
.github/workflows/deploy.yml
vendored
@ -1,55 +0,0 @@
|
||||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # 或者您的主分支名称
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Create artifact
|
||||
run: |
|
||||
zip -r deployment.zip . -x "*.git*"
|
||||
|
||||
- name: Deploy to server
|
||||
uses: appleboy/scp-action@master
|
||||
with:
|
||||
host: ${{ secrets.SERVER_HOST }}
|
||||
username: root
|
||||
key: ${{ secrets.SERVER_SSH_KEY }}
|
||||
source: "deployment.zip"
|
||||
target: "/tmp"
|
||||
|
||||
- name: Execute deployment commands
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.SERVER_HOST }}
|
||||
username: root
|
||||
key: ${{ secrets.SERVER_SSH_KEY }}
|
||||
script: |
|
||||
# 解压文件
|
||||
unzip -o /tmp/deployment.zip -d /opt/1panel/apps/openresty/openresty/www/sites/random-api.czl.net/index2
|
||||
|
||||
# 删除 index 目录下的所有文件
|
||||
rm -rf /opt/1panel/apps/openresty/openresty/www/sites/random-api.czl.net/index/*
|
||||
|
||||
# 移动文件,采用覆盖模式
|
||||
mv -f /opt/1panel/apps/openresty/openresty/www/sites/random-api.czl.net/index2/* /opt/1panel/apps/openresty/openresty/www/sites/random-api.czl.net/index/
|
||||
|
||||
# 删除 index2 文件夹
|
||||
rm -rf /opt/1panel/apps/openresty/openresty/www/sites/random-api.czl.net/index2
|
||||
|
||||
# 设置目录及其子文件的所有权和权限
|
||||
chown -R 1000:1000 /opt/1panel/apps/openresty/openresty/www/sites/random-api.czl.net/index
|
||||
chmod -R 0755 /opt/1panel/apps/openresty/openresty/www/sites/random-api.czl.net/index
|
||||
|
||||
# 清理临时文件
|
||||
rm /tmp/deployment.zip
|
||||
|
||||
# 重启容器
|
||||
docker restart random-api
|
Loading…
x
Reference in New Issue
Block a user