SWDev Story

SWDev Story: Deployment

artifacts, containers, CI/CD, platforms

8.0 What is Deployment?

Deployment is the process of moving a finished software artifact - a binary, library, web application, or service - to the environment where it will be used. A good deployment process is repeatable, auditable, and fast enough to run on every significant change. The deployment chain typically looks like this:
Source code  ->  build  ->  test  ->  package  ->  deploy  ->  running system
                                          |
                                   (artifact: binary, image, archive)
Each arrow is an opportunity for automation. Continuous Integration (CI) automates the build and test steps. Continuous Delivery (CD) automates packaging and deployment to staging or production.

8.1 Build Artifacts

A build artifact is the output of a build - what you actually deploy. Common artifact types by language:
Artifact Types by Language
LanguageArtifactNotes
Rust Native binary or .so/.dll Statically linked by default - one file, no runtime dependency.
C++ Native binary, static lib (.a), or shared lib (.so/.dll) Dynamic linking requires the matching runtime on the target machine.
C# .dll assembly, self-contained executable, or NuGet package Self-contained publish bundles the .NET runtime - no installation needed.
Python .whl wheel, PyPI package, or frozen executable (PyInstaller) Wheel is the standard distributable; PyInstaller bundles the interpreter.
Any Docker image Packages the binary and all dependencies into an isolated container image.

8.2 Containers

A container packages an application and all its dependencies into a single, portable unit. The container runs identically on any machine that has a container runtime (Docker, Podman). It eliminates "works on my machine" problems. Docker is the most widely used container tool. A Dockerfile describes how to build a container image:
# Build stage - compile the binary
FROM rust:1.78 AS builder
WORKDIR /app
COPY . .
RUN cargo build --release

# Runtime stage - minimal image with just the binary
FROM debian:bookworm-slim
COPY --from=builder /app/target/release/textfinder /usr/local/bin/textfinder
ENTRYPOINT ["textfinder"]
Key Docker concepts:
  • Image - an immutable snapshot built from a Dockerfile. Stored in a registry (Docker Hub, GitHub Container Registry).
  • Container - a running instance of an image. Isolated filesystem and network; ephemeral by default.
  • Volume - a persistent storage mount that survives container restarts.
  • Compose - docker-compose.yml defines a multi-container application (app + database + cache) as a single unit.
  • Multi-stage build - separate build and runtime stages keep the final image small; the builder stage is discarded.

8.3 CI/CD Pipelines

A CI/CD pipeline runs automatically on every push or pull request. It ensures that code is always in a deployable state and gives the team immediate feedback when a change breaks something. GitHub Actions is the CI/CD system built into GitHub. A workflow is defined in a YAML file under .github/workflows/:
name: CI

on: [push, pull_request]

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - name: Build
        run: cargo build --release
      - name: Test
        run: cargo test
This workflow runs on every push and pull request, builds the project in release mode, and runs all tests. A failed test blocks merging the PR. A continuous delivery pipeline extends CI with deployment steps:
  1. Build and test (same as CI).
  2. Build and push the Docker image to a registry.
  3. Deploy to a staging environment and run smoke tests.
  4. After manual approval (or automatically), deploy to production.

8.4 Deployment Platforms

Where software runs after deployment depends on the type of application:
Platform Options
PlatformDescription and Typical Use
Local machine CLI tools and desktop applications run directly on the developer's or user's machine. The artifact is a native binary or language-runtime-dependent package.
Virtual Machine (VM) A full OS running inside a hypervisor (VMware, Hyper-V, VirtualBox). Strong isolation; heavier than containers; common in enterprise environments.
Container (Docker/Podman) Lightweight process isolation sharing the host OS kernel. Faster startup than VMs; portable across any host with a container runtime.
GitHub Pages / Netlify Static site hosting - deploy HTML/CSS/JS by pushing to a branch. Zero server management; suitable for documentation and static web apps.
Cloud (AWS, Azure, GCP) Scalable compute, storage, and managed services. Applications run in VMs, containers (ECS, AKS), or serverless functions (Lambda, Functions).
GitHub Codespaces Cloud-hosted development environment - the entire dev setup runs in a browser-accessible container configured by a devcontainer.json.

8.5 References

Deployment References
ResourceDescription
Docker Get Started Docker's official tutorial - images, containers, Dockerfiles, and Compose.
GitHub Actions Docs Complete reference for GitHub Actions workflows, triggers, and marketplace actions.
GitHub Actions - Rust Official guide for building and testing Rust projects in GitHub Actions.
SW Deploy Bites: Introduction Deploy Bites introduction with outline of deployment topics from this track.