This project demonstrates a complete workflow for building, testing, packaging, and deploying a Spring Boot application that integrates with RabbitMQ. The CI/CD pipeline uses GitHub Actions, Docker Hub, and ngrok SSH tunneling to deploy automatically to a local macOS host.
ngrok is a tunneling tool that lets you securely expose your local machine (like your Mac) to the public internet through a temporary public URL. It’s especially useful when your local server (e.g., localhost:8080 or SSH port 22) needs to be accessed remotely — for example, by GitHub Actions, mobile apps, or teammates.
With ngrok you can:
- Expose a local HTTP server (e.g., Spring Boot) at http://localhost:8080
- Forward your local SSH port 22 for secure remote access
- Test webhooks, APIs, or CI/CD deployments from external systems
- Avoid opening firewall ports or configuring static IP addresses
Run this to expose your local SSH service:
ngrok tcp 22Install RabbitMQ with Homebrew:
brew install rabbitmq
brew services start rabbitmqRabbitMQ runs at:
- AMQP: localhost:5672
- Management UI: http://localhost:15672
- (Default username/password: guest / guest)
./mvnw spring-boot:run -Dspring-boot.run.arguments="--server.port=8081"Example call:
curl -X POST http://localhost:8080/api/send -H "Content-Type: text/plain" -d "Hello RabbitMQ"Message received in the springboot-app container(after CI/CD):

Each push to main triggers an automated workflow:
- Build and test using Maven.
- Build a Docker image.
- Push the image to Docker Hub.
- SSH into macOS (via ngrok).
- Pull and restart the container with the latest image.
Note:
- Ngrok hostname and port changes everytime you restart the service.
- You need to give write access to docker token.
| Name | Description |
|---|---|
| DOCKER_USERNAME | Your Docker Hub username |
| DOCKER_PASSWORD | Docker Hub access token |
| SERVER_HOST | ngrok hostname (e.g., 2.tcp.us-cal-1.ngrok.io) |
| SERVER_USER | Local macOS username |
| SSH_PRIVATE_KEY | Private key for GitHub Actions to SSH into your Mac |
