Files
KCAPDemoServer/.github/workflows/docker-publish.yml
Matt Hills c7f20bc04e Add automated Docker Hub publishing workflow
- Add GitHub Actions workflow for building and publishing Docker images
- Trigger on version tags (v*) to publish to Docker Hub
- Update README with Docker Hub deployment instructions
2025-10-20 20:22:43 -04:00

36 lines
916 B
YAML

name: Build and Push Docker Image
on:
push:
tags:
- 'v*' # triggers only on version tags like v1.0.0, v25.04, etc.
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Build and push Docker image with two tags
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
mattintech/kcapdemoserver:latest
mattintech/kcapdemoserver:${{ env.VERSION }}