From 2f32171b006507263b0c187fe342f0cd4fedc72d Mon Sep 17 00:00:00 2001 From: wood Date: Thu, 11 Jul 2024 19:08:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=87=AA=E5=8A=A8=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=EF=BC=8C=E5=88=A0=E9=99=A4=E2=80=9C=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 52 ++++++++++++++++++++++++++++++++++++ index.md | 6 ----- url.json | 3 +-- url/pic/test.csv | 6 ----- 所有文件url.txt | 12 --------- 5 files changed, 53 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 url/pic/test.csv delete mode 100644 所有文件url.txt diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..0f5f644 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,52 @@ +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-file.czl.net/index2 + + # 删除 index 目录下的所有文件 + rm -rf /opt/1panel/apps/openresty/openresty/www/sites/random-api-file.czl.net/index/* + + # 移动文件,采用覆盖模式 + mv -f /opt/1panel/apps/openresty/openresty/www/sites/random-api-file.czl.net/index2/* /opt/1panel/apps/openresty/openresty/www/sites/random-api-file.czl.net/index/ + + # 删除 index2 文件夹 + rm -rf /opt/1panel/apps/openresty/openresty/www/sites/random-api-file.czl.net/index2 + + # 设置目录及其子文件的所有权和权限 + chown -R 1000:1000 /opt/1panel/apps/openresty/openresty/www/sites/random-api-file.czl.net/index + chmod -R 0755 /opt/1panel/apps/openresty/openresty/www/sites/random-api-file.czl.net/index + + # 清理临时文件 + rm /tmp/deployment.zip diff --git a/index.md b/index.md index efcf6de..34dc2a6 100644 --- a/index.md +++ b/index.md @@ -19,12 +19,6 @@ | ---------- | ---------------- | | 所有 | [https://random-api.czl.net/video/all](https://random-api.czl.net/video/all) | -## 功能测试(勿用) - -| 种类 | 请求地址 | -| ---------- | ---------------- | -| 格式测试 | [https://random-api.czl.net/pic/test](https://random-api.czl.net/pic/test) | - ## 部署、更新和原理 diff --git a/url.json b/url.json index 737e848..6fba94c 100644 --- a/url.json +++ b/url.json @@ -6,8 +6,7 @@ "truegirl": "https://random-api-file.czl.net/url/pic/truegirl.csv", "ecy": "https://random-api-file.czl.net/url/pic/ecy.csv", "ecy1": "https://random-api-file.czl.net/url/pic/ecy1.csv", - "ecy2": "https://random-api-file.czl.net/url/pic/ecy2.csv", - "test": "https://random-api-file.czl.net/url/pic/test.csv" + "ecy2": "https://random-api-file.czl.net/url/pic/ecy2.csv" }, "video": { "all": "https://random-api-file.czl.net/url/video/all.csv" diff --git a/url/pic/test.csv b/url/pic/test.csv deleted file mode 100644 index 5cf5b9d..0000000 --- a/url/pic/test.csv +++ /dev/null @@ -1,6 +0,0 @@ -#test -https://cdn-oracle.czl.net/img/2024/04/662a826655a8d.webp -#test1 - -#test2 -https://cdn-oracle.czl.net/img/2024/04/662a826655a8d.webp \ No newline at end of file diff --git a/所有文件url.txt b/所有文件url.txt deleted file mode 100644 index 6b589db..0000000 --- a/所有文件url.txt +++ /dev/null @@ -1,12 +0,0 @@ -https://random-api-file.czl.net/url/pic/all.csv -https://random-api-file.czl.net/url/pic/fjht.csv -https://random-api-file.czl.net/url/pic/czl-website-background.csv -https://random-api-file.czl.net/url/pic/truegirl.csv -https://random-api-file.czl.net/url/pic/ecy.csv -https://random-api-file.czl.net/url/pic/ecy1.csv -https://random-api-file.czl.net/url/pic/ecy2.csv -https://random-api-file.czl.net/url/pic/test.csv -https://random-api-file.czl.net/url/video/all.csv -https://random-api-file.czl.net/index.md -https://random-api-file.czl.net/url.json -https://random-api-file.czl.net \ No newline at end of file