Loading GitHub Actions to Travis CI Converter...
Please wait a moment

How to Convert GitHub Actions to Travis CI - Step by Step Guide

Step 1

Input Your GitHub Actions Workflow

Start with your existing GitHub Actions workflow file. Maybe a project still builds on Travis CI, or you want both services to run the same checks:

•
Paste directly: Copy a workflow from .github/workflows/ into the editor.
•
Upload file: Click "Upload" and pick the .yml file.
•
Try sample: Click "Sample" to load a Node.js workflow with a version matrix.

Example: GitHub Actions Workflow

Here's what a typical GitHub Actions workflow looks like:

name: CI

on:
  push:
    branches: [ main, develop ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x, 16.x, 18.x]

    steps:
    - uses: actions/checkout@v3

    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'

    - name: Install dependencies
      run: npm ci

    - name: Run tests
      run: npm test
Step 2

What Gets Converted

The converter reads your GitHub Actions workflow and writes the Travis CI version of each part:

•
Language: Picked from setup-node, setup-python, setup-ruby, setup-java, setup-go or setup-php, or guessed from the commands. The version goes into node_js:, python:, rvm:, jdk:, go: or php:.
•
Steps: Install commands at the start go into install:, the rest into script:, and steps guarded by success() or failure() into after_success: and after_failure:. Multi-line run blocks stay one command.
•
Jobs and needs: Several jobs become jobs: include: entries, and needs becomes build stages that run one after another.
•
Triggers: push and pull_request branch and tag filters become one if: condition.
•
Matrix builds: A matrix becomes Travis's own version and env lists, or one build job per combination when include or exclude is used.
•
Runners: ubuntu-22.04 becomes os: linux with dist: jammy, macOS runners become os: osx and Windows runners os: windows.

Example: Converted Travis CI Configuration

The workflow above as a Travis CI .travis.yml (the comment block with notes is left out here):

language: node_js
os: linux
node_js:
  - 14.x
  - 16.x
  - 18.x
cache:
  npm: true
if: (type = push AND (tag IS blank AND branch IN (main, develop))) OR (type = pull_request AND branch = main)
install:
  - npm ci
script:
  - npm test
Step 3

Review the Notes

The comment block at the top of the file lists what still needs your attention, job by job:

•
Secrets: Add each secret as an environment variable in the repository settings on Travis CI, or encrypt it with travis encrypt.
•
Actions: Marketplace actions become placeholder echo commands. Replace them with a script, a Travis addon or a deploy provider.
•
Failing commands: Travis keeps running the remaining script: commands after one fails, while GitHub stops at the first failure.
•
Schedules: Cron jobs are set up in the repository settings, not in the file.
Step 4

Set It Up in Travis CI

•
Download: Click "Download" to save the .travis.yml file.
•
Commit: Put it in the root of your repository.
•
Connect: Sign in to Travis CI and turn the repository on.
•
Run: Push a commit and compare the first build with the GitHub run.

Frequently Asked Questions

What carries over, and what is left for me?

Every job is converted. A workflow with one job becomes a plain .travis.yml; with several jobs you get jobs: include: entries, and needs turns into build stages. Matrices become language version lists or one build job per combination, push and pull_request filters become a single if: condition, run steps go into install: and script:, success() and failure() steps go into after_success: and after_failure:, and caches become cache: settings. Marketplace actions, artifacts, environments and job outputs have no Travis form; they are listed in a comment block at the top of the file, and actions get a placeholder command you can find and replace.

How are GitHub secrets and expressions handled?

A line like NPM_TOKEN: ${{ secrets.NPM_TOKEN }} is left out, because Travis already exports a repository variable of that name once you add it under the repository settings (or encrypt it with travis encrypt). When the names differ, the value becomes "${API_TOKEN}". ${{ github.sha }} becomes ${TRAVIS_COMMIT}, ${{ matrix.db }} becomes an environment variable set for each build job, and the language version is read from Travis's own variable such as $TRAVIS_NODE_VERSION. Anything else is kept as typed and named in the notes.

Will values like long IDs, zip codes or dates change?

No. Env values and script text keep the exact characters you typed, so 8901240544102066246, 00501, 14.50 and yes come out unchanged, and a numeric value such as 42 is no longer dropped. Values with spaces or shell characters are single-quoted so the shell reads them literally, the same way GitHub passes them.

How do push, pull request and schedule triggers map?

They become one if: condition at the top of the file, using Travis's branch, tag and type fields. For a pull request build Travis sets branch to the target branch, so pull_request: branches: [main] becomes type = pull_request AND branch = main. Glob patterns such as release/** become regular expressions. A cron schedule only lets cron builds through; the schedule itself is set up in the repository settings on Travis CI, which offers daily, weekly and monthly runs.

How are service containers and matrices converted?

Services are started with docker run in before_install, with the same image, env values and port mappings, so a postgres:16 service with ports: 5432:5432 is still reachable on localhost:5432. A matrix on a single job turns into Travis's own matrix (node_js: and env: jobs: lists), which Travis expands into the same combinations. With include or exclude entries, or in a workflow with several jobs, each combination is written out as its own build job.

Is my workflow uploaded anywhere?

No. The conversion runs in your browser; nothing is sent to a server or kept, and a reload brings back an empty editor.

Going the other way? The Travis CI to GitHub Actions converter does the reverse, and the same workflow can also be turned into a CircleCI config or a .gitlab-ci.yml.