How to deploy
๐ How to Deploy an Application Using GitHub Actionsยถ
This guide explains how to deploy your application using GitHub Actions, with best practices for Unibeam environments on AWS EKS and Kubernetes.
๐ ๏ธ Prerequisitesยถ
Required Setup
- Ensure your application repository contains a valid GitHub Actions workflow (e.g.,
.github/workflows/service-env.yaml). - You must have access to necessary secrets and variables (AWS credentials, GitHub App keys, etc.).
- The target environment (e.g.,
dev,prod) and service name must be known.
๐ฆ Step 1: Trigger the Workflowยถ
You can manually trigger the deployment workflow from the GitHub UI:
- Navigate to your repository's Actions tab.
- Select the workflow (e.g.,
service-env.yaml). - Click Run workflow.
- Fill in the required inputs:
environment: Target environment (e.g.,dev,prod,mtn-poc)service: Service name (e.g.,dashboard-service,sms-service)source_revision: Source branch (e.g.,master)- Other options as needed
โ๏ธ Step 2: Build and Push Docker Imageยถ
The workflow will:
- Checkout the service repository.
- Build the Docker image using Maven or Docker (depending on the service).
- Push the image to the configured Amazon ECR registry.
Automated Build
The build step uses Maven's jib plugin or Docker commands, depending on the service type.
# Example build step (simplified)
- name: Build & Push Docker Image
run: |
mvn -B package jib:build -Dmaven.test.skip=true -Drevision=$IMAGE_TAG
๐ Step 3: Update Deployment Manifestsยถ
After building the image, the workflow updates the deployment manifests in the ArgoCD repository:
- Checks out the ArgoCD repo.
- Updates the
values.yamlfile for the target service with the new image tag. - Commits and pushes the change to the appropriate branch.
ArgoCD Integration
The workflow uses a YAML update action to automate manifest changes.
# Example manifest update step
- name: Update ARGO Apps values.yaml file
uses: fjogeleit/yaml-update-action@main
with:
valueFile: "services-applications/dev-us/apps/dashboard-service/values.yaml"
propertyPath: image.tag
value: ${{ needs.build.outputs.image_tag }}
๐ฆ Step 4: Monitor Deployment Statusยถ
- The workflow sends Slack notifications for build and deploy status.
- You can monitor progress in the GitHub Actions UI and Slack.
Troubleshooting
If deployment fails, review the logs in the Actions UI and check Slack notifications for error details.
๐ Summary Tableยถ
| Step | Description | Output Location |
|---|---|---|
| Trigger Workflow | Start deployment from GitHub UI | GitHub Actions |
| Build & Push Image | Build Docker image and push to ECR | Amazon ECR |
| Update Manifests | Update ArgoCD values.yaml with new image tag | ArgoCD repository |
| Monitor Status | Slack notifications and Actions UI logs | Slack, GitHub Actions |