2.6 KiB
2.6 KiB
GitHub Actions Configuration
This repository contains two separate GitHub Actions workflows for building and deploying your application:
Workflows
1. Build Workflow (build.yml)
- Trigger: Manual dispatch only
- Purpose: Builds Docker image and pushes to private container registry
2. Deploy Workflow (deploy.yml)
- Trigger: Manual dispatch only
- Purpose: Deploys application to Kubernetes cluster with Traefik ingress
Required GitHub Secrets
You need to configure the following secrets in your GitHub repository settings:
Container Registry Secrets
CONTAINER_REGISTRY- Your private container registry URL (e.g.,myregistry.azurecr.io)REGISTRY_USERNAME- Username for container registry authenticationREGISTRY_PASSWORD- Password/token for container registry authenticationIMAGE_NAME- Name of your container image (e.g.,www-cialloo-com)
Kubernetes Secrets
KUBECONFIG_BASE64- Base64 encoded kubeconfig file for your remote K8s clusterK8S_NAMESPACE- Kubernetes namespace to deploy to (e.g.,defaultorproduction)
Application Secrets
APP_NAME- Name of your application in Kubernetes (e.g.,www-cialloo-com)HOST- Your domain host (e.g.,www.cialloo.com)
How to Use
Building an Image
- Go to Actions tab in your GitHub repository
- Select "Build Container Image" workflow
- Click "Run workflow"
- Optionally specify a custom tag (defaults to 'latest')
Deploying to Kubernetes
- Go to Actions tab in your GitHub repository
- Select "Deploy to Kubernetes" workflow
- Click "Run workflow"
- Specify the image tag to deploy (e.g., 'latest', 'v1.0.0')
- Optionally specify environment (defaults to 'production')
Setup Instructions
1. Configure Secrets
Add all the required secrets listed above in your GitHub repository:
- Go to Settings → Secrets and variables → Actions
- Click "New repository secret" for each secret
2. Get Base64 Kubeconfig
To get your KUBECONFIG_BASE64 secret:
# On your local machine with kubectl configured for your cluster
cat ~/.kube/config | base64 -w 0
Copy the output and use it as the KUBECONFIG_BASE64 secret value.
3. Container Registry Setup
Make sure your private container registry is set up and you have credentials that can push images.
Architecture
The deployment creates:
- Deployment: 2 replicas of your application
- Service: ClusterIP service exposing port 80 → 5173
- IngressRoute: Traefik ingress without TLS
The application runs npm run dev and serves on port 5173 inside the container.