Deploy
The smurf deploy command runs an end-to-end pipeline: build a Docker image, push it to a configured registry, and optionally deploy via Helm — all driven by smurf.yaml.
Synopsis
Flags:
| Flag | Description |
|---|---|
--timeout |
Timeout in seconds for the push and Helm operations (default 600) |
Prerequisites
- A valid
smurf.yamlin the current directory (create one withsmurf init) imageNameset undersdkr- At least one registry flag enabled (
awsECR,dockerHub,ghcrRepo, orgcpRepo) - For Helm deployment:
deployHelm: truewithreleaseNameandchartNameset
Workflow
flowchart TD
A[Read smurf.yaml] --> B{Registry selected?}
B -->|awsECR| C[Build + Push to ECR]
B -->|dockerHub| D[Build + Push to Docker Hub]
B -->|ghcrRepo| E[Build + Push to GHCR]
B -->|gcpRepo| F[Build + Push to GCP]
B -->|none| G[Skip push]
C --> H{deployHelm?}
D --> H
E --> H
F --> H
G --> H
H -->|yes| I[Update values.yaml image fields]
I --> J{Release exists?}
J -->|no| K[helm install]
J -->|yes| L[helm upgrade]
H -->|no| M[Done]
K --> M
L --> M
Configuration example
sdkr:
awsECR: true
imageName: "123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app:v1.1.9"
selm:
deployHelm: true
releaseName: "my-app"
namespace: "production"
chartName: "./charts/my-app"
fileName: "values.yaml"
Usage
# Ensure config exists
smurf init
# Edit smurf.yaml with your registry and Helm settings, then:
smurf deploy
Registry behavior
| Flag | Registry | Image format |
|---|---|---|
awsECR: true |
AWS ECR | ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPO:TAG |
dockerHub: true |
Docker Hub | username/image:tag |
ghcrRepo: true |
GitHub Container Registry | ghcr.io/owner/image:tag |
gcpRepo: true |
GCP GCR / Artifact Registry | gcr.io/project/image:tag or REGION-docker.pkg.dev/... |
If no registry flag is set, Smurf skips the push step and logs a warning.
Helm integration
When deployHelm: true:
- Smurf locates the values file (
fileNameorvalues.yamlin the chart directory) - Updates
image.repositoryandimage.tagwith the pushed image details - Runs
helm installif the release does not exist, otherwisehelm upgrade
GitHub Actions example
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Smurf
uses: clouddrove/[email protected]
with:
version: v1.1.9
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy
run: smurf deploy
Related commands
- Configuration — full
smurf.yamlreference - Docker (sdkr) — individual Docker commands
- Helm (selm) — individual Helm commands