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
5275b14326
commit
2f32171b00
52
.github/workflows/deploy.yml
vendored
Normal file
52
.github/workflows/deploy.yml
vendored
Normal file
@ -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
|
6
index.md
6
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) |
|
||||
|
||||
|
||||
## 部署、更新和原理
|
||||
|
||||
|
3
url.json
3
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"
|
||||
|
@ -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
|
|
12
所有文件url.txt
12
所有文件url.txt
@ -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
|
Loading…
x
Reference in New Issue
Block a user