Abeshith's picture
Docker image Build and deploy to HF Spaces Via CI/CD Steps
f6764f3
# CI/CD Workflows
Automated pipelines using GitHub Actions.
## Workflows
### 1. CI Pipeline (`ci.yaml`)
**Triggers**: Push to main, Pull Requests
**Actions**:
- Lint code with flake8
- Format check with black
- Validate dependencies
### 2. Docker Build (`docker-build.yaml`)
**Triggers**: Push to main, Version tags
**Actions**:
- Build Docker image
- Push to GitHub Container Registry (ghcr.io)
- Tag with SHA and latest
**Access image**:
```bash
docker pull ghcr.io/your-username/automl-mlops-pipeline:latest
```
### 3. HuggingFace Deploy (`deploy-hf-space.yaml`)
**Triggers**: Version tags, Manual dispatch
**Actions**:
- Push code to HuggingFace Space
- Auto-deploy live demo
## Setup
### Required Secrets
Add these in GitHub Settings → Secrets:
1. **For Docker Build**: None (uses `GITHUB_TOKEN` automatically)
2. **For HuggingFace Deploy**:
- `HF_TOKEN`: Your HuggingFace access token
- `HF_SPACE_NAME`: Your space name (e.g., `username/automl-demo`)
### Get HuggingFace Token
1. Go to https://huggingface.co/settings/tokens
2. Create "Write" access token
3. Add as `HF_TOKEN` secret in GitHub
## Manual Triggers
Trigger HuggingFace deployment manually:
```
Actions tab → Deploy to HuggingFace Space → Run workflow
```
## View Container Images
Visit: https://github.com/your-username/automl-mlops-pipeline/pkgs/container/automl-mlops-pipeline