ci: publish docker image to docker hub

This commit is contained in:
ShukeBta
2026-05-29 01:13:47 +08:00
parent af4bb04fa4
commit b0387ed40e
6 changed files with 14 additions and 14 deletions
+6 -6
View File
@@ -6,7 +6,6 @@ on:
permissions: permissions:
contents: read contents: read
packages: write
jobs: jobs:
docker: docker:
@@ -17,18 +16,19 @@ jobs:
- uses: docker/setup-qemu-action@v3 - uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3 - uses: docker/setup-buildx-action@v3
- name: Log in to GHCR - name: Log in to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ghcr.io # Configure these in GitHub repository Settings → Secrets and variables → Actions.
username: ${{ github.actor }} # DOCKERHUB_USERNAME should normally be "shukbet".
password: ${{ secrets.GITHUB_TOKEN }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract image metadata - name: Extract image metadata
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
images: ghcr.io/shukebta/mediastation-go images: shukbet/mediastationgo
tags: | tags: |
type=raw,value=latest type=raw,value=latest
type=ref,event=tag type=ref,event=tag
+3 -3
View File
@@ -170,7 +170,7 @@ MediaStationGo 采用完全开源路线,核心媒体库、刮削、播放、
| 下载联动 | qBittorrent / PT Site Adapter | 站点搜索、订阅、下载任务展示与脱敏 | | 下载联动 | qBittorrent / PT Site Adapter | 站点搜索、订阅、下载任务展示与脱敏 |
| 外部兼容 | Emby-style API / DLNA | 面向外部播放器与三端客户端 | | 外部兼容 | Emby-style API / DLNA | 面向外部播放器与三端客户端 |
| 部署 | Docker / Docker Compose / Shell / PowerShell | NAS、Linux、Windows 均可部署 | | 部署 | Docker / Docker Compose / Shell / PowerShell | NAS、Linux、Windows 均可部署 |
| CI/CD | GitHub Actions / GHCR | 仅版本标签触发多架构镜像与 Release 包发布 | | CI/CD | GitHub Actions / Docker Hub | 仅版本标签触发多架构镜像与 Release 包发布 |
--- ---
@@ -306,7 +306,7 @@ vim docker-compose.yml
services: services:
mediastation-go: mediastation-go:
image: ghcr.io/shukebta/mediastation-go:${MEDIASTATION_IMAGE_TAG:-latest} image: shukbet/mediastationgo:${MEDIASTATION_IMAGE_TAG:-latest}
pull_policy: always pull_policy: always
container_name: mediastation-go container_name: mediastation-go
restart: unless-stopped restart: unless-stopped
@@ -910,7 +910,7 @@ PT 下载 URL 常包含私有 Token。下载中心和订阅管理会主动隐藏
### Q: 可以只保留哪个 Docker 包? ### Q: 可以只保留哪个 Docker 包?
保留 `ghcr.io/shukebta/mediastation-go` 即可;旧的 `mediastationgo` 包可以删除,避免用户拉错镜像。 以后统一使用 Docker Hub 镜像 `shukbet/mediastationgo`;旧的 `ghcr.io/shukebta/mediastation-go` / `mediastationgo` 包可以删除或归档,避免用户拉错镜像。
--- ---
+2 -2
View File
@@ -170,7 +170,7 @@ The current base license is `GPL-3.0`, and contributions are welcome under that
| Downloads | qBittorrent / PT site adapters | Search, subscriptions, task cards, private URL redaction | | Downloads | qBittorrent / PT site adapters | Search, subscriptions, task cards, private URL redaction |
| Compatibility | Emby-style API / DLNA | External clients and player integrations | | Compatibility | Emby-style API / DLNA | External clients and player integrations |
| Deployment | Docker / Docker Compose / Shell / PowerShell | NAS, Linux, Windows, and macOS friendly | | Deployment | Docker / Docker Compose / Shell / PowerShell | NAS, Linux, Windows, and macOS friendly |
| CI/CD | GitHub Actions / GHCR | Multi-arch Docker images and release packages only on version tags | | CI/CD | GitHub Actions / Docker Hub | Multi-arch Docker images and release packages only on version tags |
--- ---
@@ -780,7 +780,7 @@ PT download URLs often include private tokens. Download and subscription views i
### Which Docker package should be kept? ### Which Docker package should be kept?
Keep `ghcr.io/shukebta/mediastation-go`. The old `mediastationgo` package can be removed to avoid users pulling the wrong image. Use `shukbet/mediastationgo` on Docker Hub. The old `ghcr.io/shukebta/mediastation-go` / `mediastationgo` packages can be removed or archived to avoid users pulling the wrong image.
--- ---
+1 -1
View File
@@ -35,7 +35,7 @@
services: services:
mediastation-go: mediastation-go:
image: ghcr.io/shukebta/mediastation-go:${MEDIASTATION_IMAGE_TAG:-latest} image: shukbet/mediastationgo:${MEDIASTATION_IMAGE_TAG:-latest}
pull_policy: always pull_policy: always
container_name: mediastation-go container_name: mediastation-go
restart: unless-stopped restart: unless-stopped
+1 -1
View File
@@ -1,5 +1,5 @@
param( param(
[string]$Image = "ghcr.io/shukebta/mediastation-go", [string]$Image = "shukbet/mediastationgo",
[string]$Tag = "latest", [string]$Tag = "latest",
[string]$Platforms = "linux/amd64,linux/arm64", [string]$Platforms = "linux/amd64,linux/arm64",
[switch]$Load [switch]$Load
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
IMAGE="${IMAGE:-ghcr.io/shukebta/mediastation-go}" IMAGE="${IMAGE:-shukbet/mediastationgo}"
TAG="${TAG:-latest}" TAG="${TAG:-latest}"
PLATFORMS="${PLATFORMS:-linux/amd64,linux/arm64}" PLATFORMS="${PLATFORMS:-linux/amd64,linux/arm64}"
PUSH="${PUSH:-1}" PUSH="${PUSH:-1}"