Loading Travis CI to GitHub Actions Converter...

How to Convert Travis CI to GitHub Actions

Step 1

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:

•
Paste directly: Copy your .travis.yml content into the editor.
•
Upload file: Click "Upload" and choose your .travis.yml file.
•
Try sample: Click "Sample" to load an example Travis CI configuration.

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 build
Step 2

Read the Generated Workflow

A moment after you stop typing, the GitHub Actions workflow appears on the right. Here is how the pieces map across:

•
Language and versions: The language becomes a setup action (setup-node, setup-python and so on); a list of versions becomes a strategy.matrix.
•
Build lifecycle: before_install, install, before_script, script and the after_* hooks become steps in order.
•
Caching: cache for npm, pip, yarn, bundler or cargo becomes an actions/cache step.
•
Branch filters: branches.only and branches.except become on.push and on.pull_request filters.
•
Environment variables: env.global becomes the job env, with every value kept exactly as you typed it.
•
Leftovers: Services, deploy providers, secrets and cron are listed in a comment block at the top rather than dropped.

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 build
Step 3

Work Through the Notes

The comment block at the top of the output lists the parts that need a human. Common ones:

•
Encrypted secrets: Add Travis encrypted variables under Settings, Secrets and variables, Actions, then reference them with ${{ secrets.NAME }}.
•
Deploy providers: before_deploy and deploy have no direct equivalent — add a release or upload step for your target.
•
Env matrix: If several builds came from env: entries, expand them under strategy.matrix.
•
Services: Databases and other services become service containers you add under the job's services: key.
Step 4

Add It to Your Repository

Save the workflow and let GitHub pick it up:

•
Download: Click "Download" to save the workflow.yml file.
•
Create the directory: Add .github/workflows/ at the root of your repository.
•
Add the workflow: Place the file in .github/workflows/.
•
Commit and push: GitHub Actions runs the workflow on your next push.

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.