How to Migrate From Bitbucket Pipelines to GitHub Actions
Bitbucket pipelines and steps map to Actions jobs and steps, image maps to container, caches map to actions/cache, and services map to service containers.
Bitbucket pipelines group ordered steps. In Actions those become jobs with needs (or steps in one job). image becomes container:, caches become actions/cache, and services become the services: block.
Concept mapping
| bitbucket-pipelines.yml | GitHub Actions |
|---|---|
pipelines.default | on: [push, pull_request] |
step: | a job or grouped steps |
image: | container: |
caches: | actions/cache |
services: | services: (service containers) |
deployment: | environment: on a job |
Before
bitbucket-pipelines.yml
image: node:20
pipelines:
default:
- step:
caches: [node]
script:
- npm ci
- npm testAfter
.github/workflows/ci.yml
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
container: node:20
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
- run: npm ci
- run: npm testWhat does not map cleanly
- Bitbucket named caches (like
node) are predefined; in Actions you spell out the path and key yourself. - Bitbucket step size (2x, 4x) is chosen inline; in Actions you pick a larger runner label instead.
- Bitbucket deployments and their permissions become environments with reviewers in Actions.
Related guides
How to Migrate From Azure Pipelines to GitHub ActionsConvert an azure-pipelines.yml to GitHub Actions, mapping stages and jobs, pool to runs-on, tasks to actions,…
How to Migrate CI Service Containers to GitHub ActionsPort database and cache sidecars from GitLab, CircleCI, or Bitbucket to GitHub Actions service containers wit…