Skip to content

/ resources / jenkins-github-actions-runbook

The Jenkins → GitHub Actions Migration Runbook

Six phases, no cutover weekend: the method we use to move teams off Jenkins without dropping a release. The whole runbook is on this page, with the OIDC trust policy and workflow snippets intact; the PDF is the same document for your team's wiki.

7-page pdf · free · v1.0

Take the PDF

No form, no email gate, no drip sequence. Same content as this page, laid out for printing and sharing inside your team.

Download the PDF

Want the migration done for you? That's the migration engagement, and it starts with a call.

Book a discovery call

scoped and priced in writing first

What do you inventory before writing any YAML?

Before any workflow gets written, produce a migration map. Every job on the controller gets one of three verdicts: port (translates to a workflow), rework (depends on a plugin or pattern with no Actions equivalent), or retire (broken or abandoned; most controllers hold more of these than anyone expects).

  • Export the job list from the controller: GET /api/json?tree=jobs[name,color]. Jobs whose color is disabled or notbuilt go straight to the retire column pending owner confirmation.

  • Audit plugins under Manage Jenkins → Plugins. For each one a pipeline actually uses, note what replaces it: most build-tool plugins become a run: step; notification plugins become marketplace actions; credential plugins become OIDC or encrypted secrets.

  • Inventory credentials. Every entry in the Jenkins credentials store gets an owner, a purpose, and a destination: OIDC (cloud access), repository/environment secret, or revocation.

  • Flag state. Jobs that rely on files left on a long-lived agent between builds will fail on clean runners. Finding them now is cheaper than finding them during the parallel run.

Which org settings, runners, and OIDC foundations come first?

Organization settings before the first workflow

  • Restrict Actions permissions to verified and allow-listed actions; pin third-party actions by commit SHA.

  • Set default workflow permissions to read-only; jobs request write scopes explicitly via permissions:.

  • Create environments (staging, production) now, with required reviewers on production. They are the release-gating primitive later.

How does OIDC replace stored cloud keys?

The stored cloud keys in the Jenkins credentials store do not migrate. Deploy jobs authenticate with short-lived tokens issued per run. For AWS, the trust policy pins the repository and environment:

# IAM role trust policy (AWS example): only this repo's production environment can assume it
{
  "Effect": "Allow",
  "Principal": { "Federated": "arn:aws:iam::ACCOUNT:oidc-provider/token.actions.githubusercontent.com" },
  "Action": "sts:AssumeRoleWithWebIdentity",
  "Condition": {
    "StringEquals": {
      "token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
      "token.actions.githubusercontent.com:sub": "repo:your-org/your-repo:environment:production"
    }
  }
}
# In the workflow: no secrets, a token minted per run
permissions:
  id-token: write
  contents: read
steps:
  - uses: aws-actions/configure-aws-credentials@v4
    with:
      role-to-assume: arn:aws:iam::ACCOUNT:role/deploy-production
      aws-region: us-east-1

Runner decision: start on GitHub-hosted runners. Self-hosted runners earn their keep later for GPU builds, licensed toolchains, network-restricted deploys, or heavy persistent caches, and they arrive with their own security homework. Do not take it on during the migration itself.

How do you run Jenkins and Actions in parallel, and when does Actions win?

Pick one pipeline that ships something real, port it, and run both systems on the same commits. Jenkins remains the system of record; Actions is on trial. Promotion criteria, agreed in writing before the trial starts:

  • Artifact parity: the two systems produce byte-identical artifacts, or the differences are explained and accepted.

  • Timing: the Actions build is at least as fast on a representative sample, caching included.

  • Failure behavior: a forced failure notifies the same people and blocks the same merges.

  • Real releases: the pipeline has shipped production releases from Actions with Jenkins still available as fallback.

Only after a pipeline meets all four does its Jenkins job get disabled, never deleted, with a pointer to the workflow that replaced it.

How do Jenkins constructs map to GitHub Actions?

Jenkins construct GitHub Actions equivalent Watch out for
Declarative stage Job, or step group within a job Stages shared a workspace; jobs do not. Pass artifacts explicitly.
Shared library Composite action or reusable workflow Version it by tag; a moving default branch recreates the shared-library drift problem.
credentials() binding OIDC for cloud; environment secrets otherwise Secrets are not passed to workflows from forks; design external-contributor CI accordingly.
Parameterized build workflow_dispatch with typed inputs Inputs are strings underneath; validate before use.
cron trigger on: schedule Runs on UTC and only on the default branch; high-traffic windows can delay starts.
Matrix axes strategy: matrix Set fail-fast deliberately; the default cancels siblings on first failure.
Post actions (always/failure) if: always() / failure() steps Cleanup belongs in the job that made the mess; runners are ephemeral anyway.
Long-lived agent workspace actions/cache or rebuilt state The pattern to kill, not port. Hidden workspace state is the top source of parallel-run surprises.

Which caching is actually worth it?

# Dependency cache keyed on the lockfile, not the branch
- uses: actions/cache@v4
  with:
    path: ~/.npm
    key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
    restore-keys: npm-${{ runner.os }}-

Same principle for Docker builds: cache-from: type=gha on buildx. Measure before and after on your own pipelines; a cache that saves four seconds is not worth its restore time.

What hardening belongs in place before production traffic?

  • Concurrency groups on deploy workflows, so two merges cannot deploy over each other: concurrency: production-deploy with cancel-in-progress: false.

  • Environment protection: production requires named reviewers; the approval screen shows exactly what ref is deploying.

  • A rehearsed rollback. Not a documented one: a rehearsed one. Run the rollback workflow against staging until it is boring, then once against production in a quiet window.

  • Release gating: deploys run only from tags or protected branches; on: push to a feature branch never reaches an environment with secrets.

  • Timeouts on every job. The default is six hours; a hung job should fail in minutes, not consume a workday of runner billing.

When can you actually turn Jenkins off?

When all five receipts exist, and not before:

  • Agreed burn-in period with zero Jenkins builds. Pick a length that includes at least one release cycle and one incident response.

  • Jenkins switched to read-only, then archived. Keep the job configs and build history export; they answer archaeology questions for a year.

  • Every credential from the old store rotated or revoked. The migration is not done while a key that lived in Jenkins still opens anything.

  • Agents terminated, DNS and firewall rules cleaned up. An orphaned build agent with cloud access is a standing invitation.

  • A written record: what ran where, what replaced it, who signed off. The receipts. Your auditor, and your future self, will ask.

The one rule that prevents the bad weekend: at no point in this runbook is there a moment where the old system is gone and the new one is unproven. If you find yourself planning a cutover weekend, something upstream was skipped.

This is the runbook our own migration engagements follow, written down with the snippets intact. Teams with a handful of Jenkinsfiles can usually run it themselves in a few sprints; controllers with years of plugin accumulation are where the scoped engagement earns its price, and the inventory phase tells you which one you have.