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
- Navigate to your HCS dashboard.
- Go to Sources then click the add button > fill in the details and click continue.
- Click Register Now to install the HCS GitHub App.
- 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).
- Complete the installation and return to the HCS dashboard.
2. Create a New Application
- On the HCS dashboard, go to yourProject > New Resource.
- Choose GitHub Repository as the source.(Private or Public)
- Select your Server then select the your Github app.
- Select the repository you want to deploy along with the branch and build pack then click continue.
- Configure the branch you want to deploy (default:
main
or any branch).
3. Set Up Deployment Options
- 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.
- Specify the build directory (e.g.,
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.
5. Monitor Builds and Deployments
- Navigate to Projects and select your app.
- View deployment logs and status under the Deployments tab.
- 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.