mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-15 16:53:42 +08:00
feat: Bump package version to 1.0.0 and enhance Docker publishing workflow with multi-platform support and dynamic tagging based on package version.
This commit is contained in:
@@ -15,6 +15,13 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get version from package.json
|
||||
id: package-version
|
||||
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
@@ -30,16 +37,16 @@ jobs:
|
||||
with:
|
||||
images: kuekhaoyang/kvideo
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=semver,pattern={{version}},value=v${{ steps.package-version.outputs.version }}
|
||||
type=semver,pattern={{major}}.{{minor}},value=v${{ steps.package-version.outputs.version }}
|
||||
type=raw,value=latest
|
||||
type=raw,value=${{ steps.package-version.outputs.version }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/386,linux/ppc64le,linux/s390x
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
@@ -543,10 +543,24 @@ docker-compose up -d
|
||||
如果你不想自己构建镜像,可以直接从 Docker Hub 拉取:
|
||||
|
||||
```bash
|
||||
# 拉取最新版本
|
||||
docker pull kuekhaoyang/kvideo:latest
|
||||
docker run -d -p 3000:3000 --name kvideo kuekhaoyang/kvideo:latest
|
||||
|
||||
# 或拉取特定版本
|
||||
docker pull kuekhaoyang/kvideo:1.0.0
|
||||
docker run -d -p 3000:3000 --name kvideo kuekhaoyang/kvideo:1.0.0
|
||||
```
|
||||
|
||||
> **✨ 多架构支持**:镜像支持 7 种平台架构,可在几乎所有设备上运行:
|
||||
> - `linux/amd64` - Intel/AMD 64位(大多数服务器、PC)
|
||||
> - `linux/arm64` - ARM 64位(Apple Silicon Mac、AWS Graviton、树莓派 4/5)
|
||||
> - `linux/arm/v7` - ARM 32位 v7(树莓派 2/3/4)
|
||||
> - `linux/arm/v6` - ARM 32位 v6(树莓派 1/Zero)
|
||||
> - `linux/386` - x86 32位(老旧 PC)
|
||||
> - `linux/ppc64le` - PowerPC 64位
|
||||
> - `linux/s390x` - IBM System z
|
||||
|
||||
#### 4. 如何更新镜像
|
||||
|
||||
当有新版本发布时,可以通过以下命令更新:
|
||||
@@ -558,6 +572,8 @@ docker pull kuekhaoyang/kvideo:latest
|
||||
docker run -d -p 3000:3000 --name kvideo kuekhaoyang/kvideo:latest
|
||||
```
|
||||
|
||||
> **🔄 自动化部署**:本项目使用 GitHub Actions 自动构建和发布 Docker 镜像。每次代码推送到 main 分支时,会自动构建多架构镜像并推送到 Docker Hub,版本号从 `package.json` 读取。
|
||||
|
||||
## 🤝 贡献
|
||||
|
||||
我们非常欢迎各种形式的贡献!请查看 [CONTRIBUTING.md](CONTRIBUTING.md) 了解详细的贡献指南。
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kvideo",
|
||||
"version": "0.1.0",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
@@ -30,4 +30,4 @@
|
||||
"tailwindcss": "^4",
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user