取消自动部署

This commit is contained in:
wood 2024-09-12 16:52:46 +08:00
parent fe40f62c46
commit 43bc465cf7
2 changed files with 2 additions and 55 deletions

View File

@ -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

View File

@ -1,5 +1,7 @@
# Random-Api 随机文件API
本项目已迁移至: [random-api-go](https://github.com/woodchen-ink/random-api-go)
**请给个star谢谢**
## 使用链接