This directory contains the GitHub Actions workflow configuration for CI/CD deployment to AWS EC2.
The following secrets need to be configured in your GitHub repository settings (Settings > Secrets and variables > Actions > New repository secret):
EC2_HOST- The public IP address or hostname of your AWS EC2 instanceEC2_USER- The username to use when connecting to the EC2 instance (e.g.,ec2-user,ubuntu)EC2_SSH_KEY- The private SSH key content for connecting to the EC2 instanceBOT_TOKEN- The Telegram bot token for the application
Your EC2 instance should have:
- Docker installed and running
- The specified user (
EC2_USER) should have permissions to run Docker commands - Port 8080 should be open in the security group
The CI/CD pipeline consists of two main jobs:
- Build: Compiles the application, builds a Docker image, and saves it as an artifact
- Deploy: Transfers the Docker image to the EC2 instance and runs it as a container
The workflow is triggered on pushes to the main branch.