From 807743aaf9c5709dbcd7ab6515a541d6ad10ea40 Mon Sep 17 00:00:00 2001 From: wood chen Date: Sat, 19 Apr 2025 17:58:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=B8=A4=E7=A7=8D=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=96=B9=E6=B3=95=E7=9A=84=E8=AF=B4=E6=98=8E=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20fork=20=E9=A1=B9=E7=9B=AE=E7=9A=84?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BF=A1=E6=81=AF=EF=BC=8C=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=8F=8D=E4=BB=A3=E8=AE=BE=E7=BD=AE=E7=9A=84=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=82=E5=90=8C=E6=97=B6=E6=9B=B4=E6=96=B0=20GitHub?= =?UTF-8?q?=20Actions=20=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E6=89=80=E6=9C=89=20.yml=20=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 1 + .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++++++++ README.md | 17 +++++++++++-- 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f77e5a7..5026884 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,6 +6,7 @@ on: - main paths-ignore: - 'README.md' + - '**.yml' jobs: build-and-deploy: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b257109 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Create Release + +on: + push: + tags: + - 'v*' + +jobs: + build-and-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Install dependencies + run: npm install --force + + - name: Build project + run: npm run build + + - name: Create zip archive + run: | + cd dist + zip -r ../nezha-dash-v1.zip . + cd .. + + - name: Extract tag name + id: get_tag + run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v2 + with: + files: nezha-dash-v1.zip + name: Release ${{ env.TAG_NAME }} + draft: false + prerelease: false + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index 1b443ec..77aa22a 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,24 @@ 2. 隐藏登录按钮 3. 可以把面板和nezha容器放到不同的服务器 -## 使用方法 +## 使用方法1 1. 下载, `npm install --force`, 然后打包 `npm run build` 2. 把打包后的文件放到网站根目录 -3. 网站设置一个api反代, nginx配置大概如下: + +## 使用方法2 + +从Release下载文件, 解压到网站根目录 + +## fork项目 + +1. fork后可以修改名称和logo等信息 +2. 改完自行打包 + + +## 设置反代 + +网站设置一个api反代, nginx配置大概如下: ```nginx location ^~ /api {