Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 168 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: Build and Publish Docker Images

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "Version tag (e.g., v1.0.0)"
required: true
type: string

concurrency:
group: docker-${{ github.ref }}
cancel-in-progress: false

env:
REGISTRY: ghcr.io
IMAGE_NAME_API: ${{ github.repository }}/api
IMAGE_NAME_APP: ${{ github.repository }}/app

jobs:
check-release-type:
name: Check if this is an app release
runs-on: ubuntu-latest
outputs:
should-build: ${{ steps.check.outputs.should-build }}
version: ${{ steps.check.outputs.version }}
steps:
- name: Check release tag format
id: check
run: |
TAG="${{ github.event.release.tag_name || github.event.inputs.version }}"
if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "should-build=true" >> $GITHUB_OUTPUT
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "✅ App release detected: $TAG"
elif [[ "$TAG" =~ ^@tuvixrss/ ]]; then
echo "should-build=false" >> $GITHUB_OUTPUT
echo "⏭️ Package release detected: $TAG - skipping Docker build"
else
echo "should-build=true" >> $GITHUB_OUTPUT
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "⚠️ Unknown tag format: $TAG - proceeding with build"
fi

build-and-push-api:
name: Build and Push API Image
runs-on: ubuntu-latest
needs: [check-release-type]
if: needs.check-release-type.outputs.should-build == 'true'
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_API }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest

- name: Build and push API image
uses: docker/build-push-action@v6
with:
context: .
file: ./packages/api/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64

build-and-push-app:
name: Build and Push App Image
runs-on: ubuntu-latest
needs: [check-release-type]
if: needs.check-release-type.outputs.should-build == 'true'
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_APP }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest

- name: Build and push App image
uses: docker/build-push-action@v6
with:
context: .
file: ./packages/app/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VITE_API_URL=http://localhost:3001/trpc
VITE_APP_VERSION=${{ needs.check-release-type.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64

create-summary:
name: Create Deployment Summary
runs-on: ubuntu-latest
needs: [check-release-type, build-and-push-api, build-and-push-app]
if: needs.check-release-type.outputs.should-build == 'true'
steps:
- name: Generate summary
run: |
VERSION="${{ needs.check-release-type.outputs.version }}"
echo "# 🐳 Docker Images Published" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Version:** \`$VERSION\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Images" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **API:** \`${{ env.REGISTRY }}/${{ env.IMAGE_NAME_API }}:$VERSION\`" >> $GITHUB_STEP_SUMMARY
echo "- **App:** \`${{ env.REGISTRY }}/${{ env.IMAGE_NAME_APP }}:$VERSION\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Usage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```yaml' >> $GITHUB_STEP_SUMMARY
echo 'services:' >> $GITHUB_STEP_SUMMARY
echo ' api:' >> $GITHUB_STEP_SUMMARY
echo " image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_API }}:$VERSION" >> $GITHUB_STEP_SUMMARY
echo ' # ... rest of config' >> $GITHUB_STEP_SUMMARY
echo ' app:' >> $GITHUB_STEP_SUMMARY
echo " image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_APP }}:$VERSION" >> $GITHUB_STEP_SUMMARY
echo ' # ... rest of config' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,36 @@ Tuvix supports two deployment methods:

See the **[Deployment Guide](./docs/deployment.md)** for detailed instructions.

> **📦 Docker Images Coming Soon:** Pre-built container images will be published to a container registry once the project reaches a stable release. For now, use the Dockerfiles and docker-compose scripts included in the repository.

### Quick Start (Docker)

The docker-compose.yml works with both pre-built images and source builds:

**Option 1: Pre-built Images (Recommended - Fast)**

```bash
# Create directory and download files
mkdir Tuvix-RSS && cd Tuvix-RSS
curl -O https://raw.githubusercontent.com/TechSquidTV/Tuvix-RSS/main/docker-compose.yml
curl -O https://raw.githubusercontent.com/TechSquidTV/Tuvix-RSS/main/env.example
cp env.example .env

# Edit .env and configure:
# 1. BETTER_AUTH_SECRET (generate: openssl rand -base64 32)
# 2. Admin credentials (ADMIN_USERNAME, ADMIN_EMAIL, ADMIN_PASSWORD)
nano .env

# Pin to specific version (optional)
export VERSION=v0.6.1 # Or use 'latest' for newest

# Pull images and start
docker compose pull
docker compose up -d

# Access at http://localhost:5173
```

**Option 2: Build from Source**

> **⚠️ Use a Release:** The `main` branch contains active development and is not guaranteed to be stable. Always use the latest release for self-hosting.

Clone the repository and checkout the latest release:
Expand All @@ -54,6 +80,14 @@ cp env.example .env
# Edit .env and configure:
# 1. BETTER_AUTH_SECRET (generate: openssl rand -base64 32)
# 2. ADMIN_USERNAME, ADMIN_EMAIL, ADMIN_PASSWORD (for your admin user)
nano .env

# Build and start (includes git version in settings)
pnpm run docker:build
docker compose up -d

# Or build without version script
docker compose build
docker compose up -d
```

Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
services:
api:
image: ghcr.io/techsquidtv/tuvix-rss/api:${VERSION:-latest}
build:
context: .
dockerfile: ./packages/api/Dockerfile
Comment on lines +3 to 6

This comment was marked as outdated.

Expand Down Expand Up @@ -46,12 +47,14 @@ services:
- tuvix-network

app:
image: ghcr.io/techsquidtv/tuvix-rss/app:${VERSION:-latest}
pull_policy: build
build:
context: .
dockerfile: ./packages/app/Dockerfile
args:
- VITE_API_URL=${VITE_API_URL:-http://localhost:3001/trpc}
pull_policy: build
- VITE_APP_VERSION=${VITE_APP_VERSION:-docker}
container_name: tuvix-app
restart: unless-stopped
ports:
Expand Down
Loading
Loading