CI/CD Pipeline Setup
This section outlines the CI/CD pipeline configuration for the helixml/docs
repository.
Pipeline Stages
The CI/CD pipeline is designed to automate the following stages:
- Build: The pipeline begins by building the documentation website from the source code.
- Test: The pipeline executes automated tests to ensure the documentation builds correctly and meets quality standards.
- Deploy: Upon successful completion of the build and test stages, the pipeline deploys the updated documentation to the live website.
Workflow Configuration
The CI/CD workflow is defined using GitHub Actions. The workflow file is located in .github/workflows/main.yml
.
Triggering the Pipeline
The CI/CD pipeline is triggered automatically on every push to the main
branch of the repository.
Example Workflow File (.github/workflows/main.yml
)
name: CI/CD
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: npm install
- name: Build documentation
run: npm run build
- name: Deploy to Netlify
uses: netlify/actions/deploy@v1
with:
site_id: YOUR_NETLIFY_SITE_ID
auth_token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
publish_dir: dist
Notes:
site_id
: ReplaceYOUR_NETLIFY_SITE_ID
with your actual Netlify site ID.auth_token
: ReplaceYOUR_NETLIFY_AUTH_TOKEN
with your Netlify authentication token. This token should be stored as a secret in your GitHub repository.publish_dir
: This specifies the directory containing the built documentation website.
Testing
The CI/CD pipeline includes testing steps to ensure the quality of the documentation.
Example Test Script
# Example test script using Jest
npm test
Deployment
The CI/CD pipeline deploys the updated documentation to the live website using Netlify. The Netlify configuration is managed through the .github/workflows/main.yml
file.
Example Netlify Deployment Step
- name: Deploy to Netlify
uses: netlify/actions/deploy@v1
with:
site_id: YOUR_NETLIFY_SITE_ID
auth_token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
publish_dir: dist
Configuration:
- Ensure the
site_id
andauth_token
are correctly configured within the.github/workflows/main.yml
file.
Note: This example uses Netlify. The specific deployment process may vary based on the chosen platform.