How to Convert Travis CI to GitHub Actions
Add Your Travis CI Configuration
Start with your existing .travis.yml file. Whether you are moving because of Travis CI billing changes, for tighter GitHub integration, or for a wider set of actions:
Example: Travis CI Configuration
Here is what a typical .travis.yml looks like:
language: node_js
node_js:
- "16"
cache:
- npm
branches:
only:
- main
script:
- npm test
- npm run buildRead the Generated Workflow
A moment after you stop typing, the GitHub Actions workflow appears on the right. Here is how the pieces map across:
Example: Converted GitHub Actions Workflow
The configuration above comes out as this GitHub Actions YAML:
# Converted from Travis CI. Check these before you use the workflow:
# - Travis cron jobs are set in the Travis web UI, not in the file.
# - A script step stops at the first failing command (Travis runs them all).
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Cache npm packages
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install
run: npm ci
- name: Script
run: |-
npm test
npm run buildWork Through the Notes
The comment block at the top of the output lists the parts that need a human. Common ones:
Add It to Your Repository
Save the workflow and let GitHub pick it up:
Frequently Asked Questions
How does the converter map my .travis.yml?
Your language and version become a setup action (setup-node, setup-python, setup-go and so on). A list of versions, or a list of operating systems, becomes a strategy.matrix. The lifecycle phases — before_install, install, before_script, script, after_success, after_failure, after_script — become steps in order. env.global becomes the job env, branches.only and branches.except become on.push and on.pull_request filters, and each jobs.include entry becomes its own job with stages wired up through needs. Caching for npm, pip, yarn, bundler and cargo becomes an actions/cache step.
What does it do with things it cannot translate?
It never drops them silently. Deploy providers, services, addons, encrypted secrets, an env build matrix and Travis cron jobs are listed in a comment block at the top of the workflow, with a short note on what to do instead. For example, services become a line telling you to add service containers, and an encrypted env value becomes a reference to a GitHub secret you still need to create.
Will long IDs, zip codes or decimal values change?
No. The file is read so that every value keeps the text you typed, and commands are copied character for character, so 8901240544102066246, 00501, 14.50 and yes come out unchanged. Values a YAML reader would otherwise turn into a number, boolean or date are quoted in the workflow so they stay strings.
What about a build matrix with several versions?
A version list such as node_js: ["16", "18", "20"] becomes strategy.matrix.node and the setup step uses ${{ matrix.node }}; a list of operating systems becomes strategy.matrix.os. A Travis env matrix (several builds created from env: entries) is harder to translate automatically, so it is described in the notes for you to add under strategy.matrix by hand.
How do I migrate Travis CI encrypted secrets?
Recreate them in GitHub under Settings, Secrets and variables, Actions, then reference them in the workflow as ${{ secrets.SECRET_NAME }}. When an env value in your .travis.yml is an encrypted Travis value, the converter points it at a GitHub secret of the same name and reminds you in the notes to add it.
Is my config uploaded anywhere?
No. The conversion runs in your browser and nothing is sent to a server or kept, so a reload starts with an empty editor.
Are there other CI/CD platforms I can migrate?
Yes. We also convert CircleCI, Jenkins, Azure Pipelines and GitLab CI to GitHub Actions.
Related Tools
Jenkins to GitHub Actions
Convert Jenkins pipelines (Jenkinsfile) to GitHub Actions workflows — stages, parallel stages, when-conditions, post blocks and environment become jobs and steps, and anything it can't convert is listed in notes
GitLab CI to GitHub Actions
Convert GitLab CI/CD pipelines to GitHub Actions workflows with jobs, artifacts, and variables
CI/CD Pipeline Fixer
Fix broken CI/CD pipeline configurations automatically, repair GitHub Actions, GitLab CI, Jenkins, and Azure Pipelines YAML errors
CircleCI to GitHub Actions
Convert CircleCI config.yml to GitHub Actions workflows with jobs, caching, and artifacts
Azure Pipelines to GitHub Actions
Convert Azure Pipelines YAML to GitHub Actions workflows with jobs, tasks, and stages
GitHub Actions to GitLab CI
Convert GitHub Actions workflows to GitLab CI configuration with jobs, stages, and rules