This directory contains the GitHub Actions workflow for automated Docker image building and deployment to Dokploy.
workflows/deploy.yml- Main GitHub Actions workflow that builds and pushes Docker images to Docker Hub
DOKPLOY_SETUP.md- Quick setup guide with checklists../DEPLOYMENT.md- Comprehensive deployment documentation
../.dockerignore- Optimizes Docker builds by excluding unnecessary files
- Triggers on every push to the
mainbranch - Builds the Spring Boot application using the existing Dockerfile
- Pushes the Docker image to Docker Hub with tags:
latest- Always points to the newest versionmain-<commit-sha>- Version specific to each commit
- Enables Dokploy to pull and deploy the pre-built image
- No Server Overload: Builds happen on GitHub's infrastructure, not your Dokploy server
- Faster Deployments: Pre-built images download much faster than building from source
- Automatic: Just push code and it deploys automatically
- Versioned: Every deployment is tagged with the commit SHA
- Zero Downtime: When configured with health checks in Dokploy
- Read: DOKPLOY_SETUP.md for quick setup
- Follow: The checklist to configure Docker Hub and GitHub secrets
- Push: Your code to trigger the first build
- Configure: Dokploy to use your Docker image
- Quick Start: DOKPLOY_SETUP.md
- Full Guide: ../DEPLOYMENT.md
- Workflow: workflows/deploy.yml
graph LR
A[Push to main] --> B[GitHub Actions]
B --> C[Build Docker Image]
C --> D[Push to Docker Hub]
D --> E[Dokploy Webhook]
E --> F[Pull & Deploy]
F --> G[Health Check]
G -->|Pass| H[Live ✅]
G -->|Fail| I[Rollback 🔄]
Edit workflows/deploy.yml:
on:
push:
branches: ["main", "production"] # Add more branchesAdd additional steps before the Docker build:
- name: Run Tests
run: ./gradlew test
- name: Run Security Scan
run: ./gradlew dependencyCheckAnalyzeFor ARM64 support, modify workflows/deploy.yml:
platforms: linux/amd64,linux/arm64- Build Status: GitHub → Actions tab
- Image Registry: Docker Hub → Your repository
- Deployment: Dokploy dashboard
If builds fail:
- Check the Actions tab for error logs
- Verify GitHub secrets are set correctly
- Ensure Dockerfile is valid
- Check Docker Hub credentials
If deployment fails:
- Verify image was pushed to Docker Hub
- Check Dokploy environment variables
- Review application logs in Dokploy
- Verify database connectivity
- Never commit Docker Hub credentials
- Use GitHub Secrets for sensitive data
- Rotate access tokens regularly
- Keep dependencies updated
Questions? Check the full deployment guide