Merge pull request #721 from kapdon/feat/docker-release-image

feat(docker): publish release images on stable tags
This commit is contained in:
Kai (Tam Nhu) Tran authored and GitHub committed 2026-03-15 13:41:08 -04:00
commit d58814e812
3 files changed
+111 -4

No files matched your search

+90
View File
@@ -0,0 +1,90 @@
name: Publish Docker Image
on:
push:
tags:
- 'v*.*.*'
concurrency:
group: docker-release-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout release tag
uses: actions/checkout@v4
- name: Validate stable semver tag
id: tag
run: |
if [[ "${GITHUB_REF_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "publish=true" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "publish=false" >> "$GITHUB_OUTPUT"
echo "Skipping non-stable semver tag ${GITHUB_REF_NAME}"
- name: Set up QEMU
if: steps.tag.outputs.publish == 'true'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: steps.tag.outputs.publish == 'true'
uses: docker/setup-buildx-action@v3
- name: Derive image metadata
if: steps.tag.outputs.publish == 'true'
id: meta
run: |
VERSION="${GITHUB_REF_NAME#v}"
MINOR="${VERSION%.*}"
MAJOR="${VERSION%%.*}"
OWNER_LOWER=$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')
IMAGE="ghcr.io/${OWNER_LOWER}/ccs-dashboard"
{
echo "version=${VERSION}"
echo "minor=${MINOR}"
echo "major=${MAJOR}"
echo "image=${IMAGE}"
} >> "$GITHUB_OUTPUT"
- name: Log in to GitHub Container Registry
if: steps.tag.outputs.publish == 'true'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push release image
if: steps.tag.outputs.publish == 'true'
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }}
${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.minor }}
${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.major }}
${{ steps.meta.outputs.image }}:latest
labels: |
org.opencontainers.image.title=ccs-dashboard
org.opencontainers.image.description=CCS Dashboard container image
org.opencontainers.image.url=https://github.com/${{ github.repository }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.version=${{ steps.meta.outputs.version }}
org.opencontainers.image.revision=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
+1 -1
View File
@@ -55,7 +55,7 @@ ccs config
Dashboard updates hub: `http://localhost:3000/updates`
Want to run the dashboard in Docker? See `docker/README.md`.
Want to run the dashboard in Docker or pull the prebuilt image? See `docker/README.md`.
### 3. Configure Your Accounts
+20 -3
View File
@@ -13,7 +13,24 @@ Persistent config, restart on reboot.
<br>
## Quick Start (Docker Run)
## Quick Start (Prebuilt Image)
Pull the latest stable release image from GitHub Container Registry:
```bash
docker run -d \
--name ccs-dashboard \
--restart unless-stopped \
-p 3000:3000 \
-p 8317:8317 \
-e CCS_PORT=3000 \
-v ccs_home:/home/node/.ccs \
ghcr.io/kaitranntt/ccs-dashboard:latest
```
Release-tag images are also published as `ghcr.io/kaitranntt/ccs-dashboard:<version>`.
## Build Locally
```bash
docker build -f docker/Dockerfile -t ccs-dashboard:latest .
@@ -62,7 +79,7 @@ docker run -d \
-e CCS_PROXY_PORT=443 \
-e CCS_PROXY_PROTOCOL="https" \
-v ccs_home:/home/node/.ccs \
ccs-dashboard:latest
ghcr.io/kaitranntt/ccs-dashboard:latest
```
## Useful Commands
@@ -108,7 +125,7 @@ docker run -d \
-p 3000:3000 \
-p 8317:8317 \
-v ccs_home:/home/node/.ccs \
ccs-dashboard:latest
ghcr.io/kaitranntt/ccs-dashboard:latest
```
Docker Compose includes default limits (1GB RAM, 2 CPUs). Adjust in `docker-compose.yml` under `deploy.resources`.