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 {