Skip to content

creating a docker demo image #1

creating a docker demo image

creating a docker demo image #1

Workflow file for this run

name: Docker Demo Build & Push
on:
push:
tags:
- 'v*'
- '[0-9]+.[0-9]+.[0-9]+'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-demo
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
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 GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Build and push Docker demo image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile-demo
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Update GitHub Release with Demo Info
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
append_body: true
body: |
## 🎮 Demo Docker Image
Try the pre-configured demo with sample data:
```bash
# Pull the demo image
docker pull ghcr.io/gcclinux/easyscheduler-demo:latest
# or
docker pull ghcr.io/gcclinux/easyscheduler-demo:${{ github.ref_name }}
# Run the demo container
docker run --name "easyscheduler-demo" -d -p 80:5001 ghcr.io/gcclinux/easyscheduler-demo:latest
```
**Demo Features:**
- 🔒 Read-only demo user (login: `demo`, password: `demo`)
- 👥 5 pre-seeded users
- 📅 8 sample appointments
- 🎨 Green theme
- 🚫 No database modifications allowed
Access at: **http://localhost**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}