diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index c2e9291..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -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 diff --git a/README.md b/README.md index fc64041..ddb1a05 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Random-Api 随机文件API +本项目已迁移至: [random-api-go](https://github.com/woodchen-ink/random-api-go) + **请给个star,谢谢** ## 使用链接