Skip to content

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

smurf deploy [flags]

Flags:

Flag Description
--timeout Timeout in seconds for the push and Helm operations (default 600)

Prerequisites

  • A valid smurf.yaml in the current directory (create one with smurf init)
  • imageName set under sdkr
  • At least one registry flag enabled (awsECR, dockerHub, ghcrRepo, or gcpRepo)
  • For Helm deployment: deployHelm: true with releaseName and chartName set

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:

  1. Smurf locates the values file (fileName or values.yaml in the chart directory)
  2. Updates image.repository and image.tag with the pushed image details
  3. Runs helm install if the release does not exist, otherwise helm 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