Skip to content

Add Docker build and multi-platform support to GitHub Actions - #297

Merged
Jaben merged 4 commits into
developfrom
feature/docker-build
Oct 7, 2025
Merged

Add Docker build and multi-platform support to GitHub Actions#297
Jaben merged 4 commits into
developfrom
feature/docker-build

Conversation

@Jaben

@Jaben Jaben commented Oct 7, 2025

Copy link
Copy Markdown
Member

Summary

This PR enhances the GitHub Actions workflow with automated Docker image builds and addresses the multi-platform Docker image support requested in #275.

Changes

Docker Build Integration

  • ✅ Add Docker Buildx setup for multi-platform builds (linux/amd64, linux/arm64)
  • ✅ Configure Docker Hub authentication using repository secrets
  • ✅ Build and push Docker images automatically on master and develop branches

Image Tagging Strategy

Master branch produces:

  • changemakerstudios/papercut-smtp:latest
  • changemakerstudios/papercut-smtp:7.0.1 (semantic version)
  • changemakerstudios/papercut-smtp:7.0 (major.minor)

Develop branch produces:

  • changemakerstudios/papercut-smtp:dev
  • changemakerstudios/papercut-smtp:7.1.0-alpha.29 (full semantic version with pre-release tag)

Build Optimizations

  • ✅ GitHub Actions cache for faster Docker builds
  • ✅ Build metadata passed as build args (version, date, VCS ref)
  • ✅ Multi-platform support for ARM64 (Apple Silicon, Raspberry Pi, etc.)

Required Repository Secrets

Before merging, add these secrets to the repository:

  • DOCKER_USERNAME - Docker Hub username
  • DOCKER_PASSWORD - Docker Hub access token

Fixes

Closes #275

Test Plan

  • Verify Docker build succeeds on develop branch
  • Confirm multi-platform images are created (amd64, arm64)
  • Validate image tags are correct for develop branch
  • Test Docker image on ARM64 platform

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Official Docker images are now published for Linux (amd64 and arm64) with latest, dev, and versioned tags.
  • Chores

    • Migrated build and release pipeline to GitHub Actions with improved artifact publishing.
    • Updated installer/updater dependency to a newer version for better reliability.
    • Upgraded build tooling to latest versions.
    • Added ignore for local settings files to prevent accidental commits.

Jaben and others added 4 commits October 7, 2025 18:58
- Remove CleanDirectory calls from individual build tasks to prevent artifacts from overwriting each other
- Replace AppVeyor-specific code with GitHub Actions equivalents (GITHUB_ACTIONS, GITHUB_TOKEN, GITHUB_REF_NAME)
- Remove UploadArtifacts task (artifacts now handled by GitHub Actions workflow)
- Add permissions: contents: write to workflow for Velopack release creation
- Remove duplicate GitHub release creation (now handled by Velopack)
- Add Service artifact attachment to releases created by Velopack
- Remove DownloadReleases task (delta updates not needed)
- Update vpk tool to latest version (0.0.1298)

This ensures all 12 artifacts (UI installers + Service zips) are properly generated and uploaded.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add Docker Buildx setup for multi-platform builds (linux/amd64, linux/arm64)
- Configure Docker Hub authentication using secrets
- Build and push Docker images on master and develop branches
- Tag master builds with :latest, version (e.g., 7.0.1), and major.minor (e.g., 7.0)
- Tag develop builds with :dev and full semantic version (e.g., 7.1.0-alpha.29)
- Enable GitHub Actions cache for faster Docker builds
- Pass build metadata (version, date, VCS ref) as build args

Fixes #275 (multi-platform Docker image support)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 7, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

Updates CI/CD to GitHub Actions with Docker build/push for amd64 and arm64, revises release artifact attachment, migrates build script from AppVeyor assumptions to GitHub Actions, bumps build dependencies and a UI package, and adds a new gitignore entry.

Changes

Cohort / File(s) Summary of changes
CI workflow updates
.github/workflows/build.yml
Added permissions. Replaced release and pre-release steps with “Attach Service artifacts to release/pre-release” targeting releases/Papercut.Smtp.Service.*.zip and fail_on_unmatched_files: false. Added Docker Buildx setup, Docker Hub login, metadata extraction, and multi-arch (linux/amd64, linux/arm64) build and push with tags derived from GitVersion.
Build script migration
build.cake
Updated tooling versions (MimeKitLite, GitVersion.Tool, vpk). Replaced AppVeyor-specific logic with GitHub Actions detection, branch handling, and token usage. Removed Download/Upload artifact tasks. Adjusted DeployReleases for GitHub Actions and simplified logging/dependencies.
Package update
src/Papercut.UI/Papercut.csproj
Bumped Velopack PackageReference from 0.0.1053 to 0.0.1298.
Ignore rules
.../src/Papercut.UI/Releases/.gitignore
Added ignore entry for settings.local.json.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub
  participant WF as Build Workflow
  participant DH as Docker Hub
  participant GR as GitHub Releases

  Dev->>GH: Push to master/develop
  GH-->>WF: Trigger workflow

  rect rgba(230,245,255,0.5)
  note over WF: Build and package
  WF->>WF: Restore, build, test
  WF->>WF: Determine version (GitVersion)
  end

  alt master or develop
    rect rgba(235,255,235,0.5)
    note over WF,DH: Docker multi-arch publish
    WF->>WF: Setup Buildx
    WF->>DH: Login
    WF->>WF: Extract Docker metadata (tags/labels)
    WF->>DH: Build & push images (amd64, arm64)
    end
  end

  rect rgba(255,245,230,0.5)
  note over WF,GR: Release asset handling
  WF->>GR: Attach Service artifacts (release/pre-release)
  end

  WF-->>GH: Job status (success/failure)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

A bunny builds on windy nights,
With multi-arch and tidy bytes.
It tags the clouds, it ships the seas,
To Docker burrows, swift as breeze.
Releases hop to GitHub’s glade—
Carrots stamped, new trails are laid. 🥕🐇

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/docker-build

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 574cd9b and 25827f7.

📒 Files selected for processing (4)
  • .github/workflows/build.yml (2 hunks)
  • .gitignore (1 hunks)
  • build.cake (4 hunks)
  • src/Papercut.UI/Papercut.csproj (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Bug: MimeKitLite Version Mismatch Causes Build Failures

The #reference directive for MimeKitLite points to version 4.5.0, but the #tool directive was updated to 4.14.0. This mismatch means the build script will try to load the assembly from a non-existent tools/MimeKitLite.4.5.0 path, causing assembly loading failures.

build.cake#L17-L18

Papercut-SMTP/build.cake

Lines 17 to 18 in 25827f7

#reference "tools/MarkdownSharp.2.0.5/lib/netstandard2.0/MarkdownSharp.dll"
#reference "tools/MimeKitLite.4.5.0/lib/netstandard2.0/MimeKitLite.dll"

Fix in Cursor Fix in Web


@Jaben
Jaben merged commit 7646adf into develop Oct 7, 2025
2 of 3 checks passed
@Jaben
Jaben deleted the feature/docker-build branch October 9, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arm64 Docker image

1 participant