Skip to content

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:

  1. Navigate to your repository's Actions tab.
  2. Select the workflow (e.g., service-env.yaml).
  3. Click Run workflow.
  4. 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

Input Example

environment: dev
service: dashboard-service
source_revision: master

โš™๏ธ 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.yaml file 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

๐Ÿ“š Referencesยถ