Skip to content

Commit 691c1cc

Browse files
committed
Add GitHub Actions CI/CD workflow and complete rebranding
- Add automated Docker image builds via GitHub Actions - Build and push 'master' tag on commits to master branch - Build and push version tags + 'latest' on GitHub releases - Multi-architecture support (amd64, arm64) - Publish to GitHub Container Registry (ghcr.io) - Update README with deployment documentation - Add pre-built image usage instructions - Document CI/CD workflow and release process - Update docker-compose examples with GHCR images - Complete package renaming - Update package.json name and description - Update package-lock.json references
1 parent b7afe93 commit 691c1cc

File tree

4 files changed

+152
-8
lines changed

4 files changed

+152
-8
lines changed

.github/workflows/docker-build.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
release:
8+
types: [published]
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
build-and-push:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Log in to GitHub Container Registry
29+
uses: docker/login-action@v3
30+
with:
31+
registry: ${{ env.REGISTRY }}
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Extract metadata (tags, labels)
36+
id: meta
37+
uses: docker/metadata-action@v5
38+
with:
39+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
40+
tags: |
41+
# Tag with 'master' on push to master branch
42+
type=raw,value=master,enable={{is_default_branch}}
43+
# Tag with version on release
44+
type=semver,pattern={{version}}
45+
type=semver,pattern={{major}}.{{minor}}
46+
type=semver,pattern={{major}}
47+
# Tag with 'latest' on release
48+
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
49+
50+
- name: Build and push Docker image
51+
uses: docker/build-push-action@v5
52+
with:
53+
context: .
54+
push: true
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}
57+
cache-from: type=gha
58+
cache-to: type=gha,mode=max
59+
platforms: linux/amd64,linux/arm64

README.md

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,41 @@ just check # Run all checks
214214

215215
## Production Deployment
216216

217-
### Docker Build
217+
### Using Pre-built Images
218+
219+
Pre-built Docker images are automatically built and published via GitHub Actions to GitHub Container Registry.
220+
221+
**Available tags:**
222+
- `ghcr.io/linuxrocker/application-directory:latest` - Latest stable release
223+
- `ghcr.io/linuxrocker/application-directory:master` - Latest commit to master branch
224+
- `ghcr.io/linuxrocker/application-directory:v1.0.0` - Specific version tag
225+
226+
**Quick start with pre-built image:**
227+
228+
```bash
229+
# Pull the latest release
230+
docker pull ghcr.io/linuxrocker/application-directory:latest
231+
232+
# Run the container
233+
docker run -d \
234+
--name application-directory \
235+
-p 80:80 \
236+
-v $(pwd)/config:/app/config \
237+
-e KEYCLOAK_ISSUER=https://your-keycloak.com/realms/dashboard \
238+
-e KEYCLOAK_CLIENT_ID=application-directory \
239+
-e KEYCLOAK_CLIENT_SECRET=your-secret \
240+
-e KEYCLOAK_REDIRECT_URI=https://dashboard.example.com/api/auth/callback \
241+
-e SESSION_SECRET=your-strong-secret \
242+
-e SESSION_SECURE=true \
243+
-e CORS_ORIGIN=https://dashboard.example.com \
244+
-e USE_REDIS_SESSIONS=true \
245+
-e REDIS_URL=redis://your-redis:6379 \
246+
ghcr.io/linuxrocker/application-directory:latest
247+
```
248+
249+
### Building From Source
250+
251+
If you prefer to build the image yourself:
218252

219253
```bash
220254
# Build the Docker image
@@ -246,14 +280,25 @@ version: '3.8'
246280

247281
services:
248282
dashboard:
249-
image: application-directory:latest
283+
image: ghcr.io/linuxrocker/application-directory:latest
250284
ports:
251285
- "80:80"
252286
volumes:
253287
- ./config:/app/config
254-
env_file:
255-
- .env.production
288+
environment:
289+
- KEYCLOAK_ISSUER=https://your-keycloak.com/realms/dashboard
290+
- KEYCLOAK_CLIENT_ID=application-directory
291+
- KEYCLOAK_CLIENT_SECRET=your-secret
292+
- KEYCLOAK_REDIRECT_URI=https://dashboard.example.com/api/auth/callback
293+
- SESSION_SECRET=your-strong-secret
294+
- SESSION_SECURE=true
295+
- CORS_ORIGIN=https://dashboard.example.com
296+
- USE_REDIS_SESSIONS=true
297+
- REDIS_URL=redis://redis:6379
298+
- CONFIG_PATH=/app/config/apps.yaml
256299
restart: unless-stopped
300+
depends_on:
301+
- redis
257302

258303
redis:
259304
image: redis:7-alpine
@@ -269,6 +314,8 @@ volumes:
269314
docker-compose -f docker-compose.prod.yml up -d
270315
```
271316

317+
**Tip:** Use `:master` tag for bleeding-edge updates or pin to a specific version like `:v1.0.0` for stability.
318+
272319
## Configuration Guide
273320

274321
### Access Control Behavior
@@ -373,6 +420,44 @@ Use Font Awesome 6 Free icon classes:
373420
- `GET /api/apps/categories` - Get all categories
374421
- `GET /api/apps/search?q=query` - Search apps
375422

423+
## CI/CD and Automated Builds
424+
425+
This project uses GitHub Actions to automatically build and publish Docker images to GitHub Container Registry.
426+
427+
### Automatic Builds
428+
429+
**On push to `master` branch:**
430+
- Builds and pushes image tagged as `master`
431+
- Use this for development/testing with latest changes
432+
433+
**On GitHub release:**
434+
- Builds and pushes image with version tags (e.g., `v1.0.0`, `1.0`, `1`)
435+
- Also tags as `latest` for easy production deployment
436+
- Multi-architecture support (amd64, arm64)
437+
438+
### Creating a Release
439+
440+
1. Create a new tag and release on GitHub:
441+
```bash
442+
git tag -a v1.0.0 -m "Release version 1.0.0"
443+
git push origin v1.0.0
444+
```
445+
446+
2. Go to GitHub → Releases → Create new release
447+
3. Select the tag you just created
448+
4. Add release notes
449+
5. Publish the release
450+
451+
6. GitHub Actions will automatically build and push:
452+
- `ghcr.io/linuxrocker/application-directory:latest`
453+
- `ghcr.io/linuxrocker/application-directory:v1.0.0`
454+
- `ghcr.io/linuxrocker/application-directory:1.0`
455+
- `ghcr.io/linuxrocker/application-directory:1`
456+
457+
### Viewing Build Status
458+
459+
Check the "Actions" tab in the GitHub repository to monitor build progress and status.
460+
376461
## Security Considerations
377462

378463
- **Confidential Client**: Always use client secret, never expose it

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "homelab-user-dashboard",
2+
"name": "application-directory",
33
"version": "1.0.0",
4-
"description": "Keycloak-authenticated dashboard for homelab applications",
4+
"description": "Keycloak-authenticated application directory",
55
"private": true,
66
"workspaces": [
77
"backend",

0 commit comments

Comments
 (0)