Skip to content

Updated demo site banner #8

Updated demo site banner

Updated demo site banner #8

name: Publish to Docker Hub
on:
push:
tags:
- 'v*' # Trigger on version tags (v4.0.0, v4.0.1, etc.)
workflow_dispatch: # Allow manual trigger from Actions tab
env:
# Update this to your Docker Hub username
DOCKERHUB_IMAGE: skrodahl/newton
jobs:
publish-dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- 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 metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKERHUB_IMAGE }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Docker Hub image published
run: |
echo "✅ Docker image published to Docker Hub"
echo "Tags: ${{ steps.meta.outputs.tags }}"
echo ""
echo "Pull with: docker pull ${{ env.DOCKERHUB_IMAGE }}:latest"