How to Convert GitHub Actions to Travis CI - Step by Step Guide
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:
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 testWhat Gets Converted
The converter reads your GitHub Actions workflow and writes the Travis CI version of each part:
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
Review the Notes
The comment block at the top of the file lists what still needs your attention, job by job:
travis encrypt.Set It Up in Travis CI
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.
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
Travis CI to GitHub Actions
Convert .travis.yml to GitHub Actions workflows with language support, caching, and lifecycle hooks