Skip to content

CI/CD Process with HCS

This guide provides step-by-step instructions on setting up CI/CD with HCS, integrating it with your GitHub repository, and automating deployments for any branch push.

Prerequisites

  • A running instance of HCS.
  • Admin access to your GitHub account.
  • A repository you want to deploy.

Steps to Configure CI/CD

1. Install the GitHub App

  1. Navigate to your HCS dashboard.
  2. Go to Sources then click the add button > fill in the details and click continue.
  3. Click Register Now to install the HCS GitHub App.
  4. You’ll be redirected to GitHub. Select:
    • The organization or user account where the app will be installed.
    • Repositories HCS should access (either select specific repos or all repos).
  5. Complete the installation and return to the HCS dashboard.
HCS GitHub App

2. Create a New Application

  1. On the HCS dashboard, go to yourProject > New Resource.
  2. Choose GitHub Repository as the source.(Private or Public)
  3. Select your Server then select the your Github app.
  4. Select the repository you want to deploy along with the branch and build pack then click continue.
  5. Configure the branch you want to deploy (default: main or any branch).
create new application

3. Set Up Deployment Options

  1. Define the Build Settings:
    • Specify the build directory (e.g., /dist for frontend apps or root for backend).
    • Add any environment variables required by your app.
    • Click Deploy.

4. Automatic Deployment Workflow

  • When you push changes to the connected branch or repository:
    • HCS detects the change through the GitHub webhook.
    • A new build is initiated automatically.
    • Once built, HCS deploys the updated application to the configured environment.
deployment logs

5. Monitor Builds and Deployments

  1. Navigate to Projects and select your app.
  2. View deployment logs and status under the Deployments tab.
  3. Ensure there are no errors in the build or deployment process.

Example Use Case: Multiple Branch Deployments

HCS allows connecting multiple branches to different environments (e.g., staging and production). Repeat the above steps for additional branches and configure environment-specific settings as needed.