146 lines
4.0 KiB
YAML
146 lines
4.0 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
discussions: write
|
|
issues: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '18'
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v2
|
|
with:
|
|
version: 8
|
|
run_install: false
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.pnpm-store
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build project
|
|
run: pnpm run build
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
package.json
|
|
pnpm-lock.yaml
|
|
next.config.js
|
|
tailwind.config.ts
|
|
tsconfig.json
|
|
Dockerfile
|
|
vercel.json
|
|
generate_release_notes: true
|
|
draft: false
|
|
prerelease: false
|
|
tag_name: ${{ github.ref_name }}
|
|
name: '🎉 Release ${{ github.ref_name }}'
|
|
body: |
|
|
## 🎉 新版本发布
|
|
|
|
**版本号**: ${{ github.ref_name }}
|
|
**发布日期**: ${{ github.event.head_commit.timestamp }}
|
|
|
|
### 🚀 快速开始
|
|
|
|
#### Docker 部署(推荐)
|
|
```bash
|
|
docker pull ghcr.io/katelya77/katelyatv:${{ github.ref_name }}
|
|
docker run -d --name katelyatv -p 3000:3000 --env PASSWORD=your_password ghcr.io/katelya77/katelyatv:${{ github.ref_name }}
|
|
```
|
|
|
|
#### Cloudflare Pages 部署
|
|
- Fork 本仓库
|
|
- 在 Cloudflare Pages 中导入项目
|
|
- 构建命令:`pnpm pages:build`
|
|
- 输出目录:`.vercel/output/static`
|
|
|
|
#### Vercel 部署
|
|
- Fork 本仓库
|
|
- 在 Vercel 中导入项目
|
|
- 构建命令:`pnpm run build`
|
|
|
|
### 📋 环境变量
|
|
|
|
| 变量 | 说明 | 默认值 |
|
|
|------|------|--------|
|
|
| PASSWORD | 访问密码 | 必填 |
|
|
| NEXT_PUBLIC_STORAGE_TYPE | 存储类型 | localstorage |
|
|
| USERNAME | 管理员账号 | 空 |
|
|
|
|
更多环境变量请查看 [README.md](README.md)
|
|
|
|
### 🔗 相关资源
|
|
|
|
- [项目文档](https://github.com/katelya77/KatelyaTV#readme)
|
|
- [问题反馈](https://github.com/katelya77/KatelyaTV/issues)
|
|
- [功能讨论](https://github.com/katelya77/KatelyaTV/discussions)
|
|
- [贡献指南](https://github.com/katelya77/KatelyaTV/blob/main/CONTRIBUTING.md)
|
|
|
|
### 📝 更新日志
|
|
|
|
查看 [CHANGELOG.md](CHANGELOG.md) 了解详细的更新历史。
|
|
|
|
---
|
|
|
|
**注意**: 本项目仅供学习和个人使用,请遵守当地法律法规。
|
|
|
|
docker:
|
|
needs: release
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and Push Docker Image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
ghcr.io/katelya77/katelyatv:${{ github.ref_name }}
|
|
ghcr.io/katelya77/katelyatv:latest
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
platforms: linux/amd64,linux/arm64
|