Switching a repository from TravisCI to GitHub Actions
These instructions are geared towards edX’s recent TravisCI → GitHub Actions migration, but they generally apply for any migration of a GitHub repository from one CI provider to another.
This guide is just about the button-clicking you need to do to switch a repo over. It assumes that you know how to rewrite your TravisCI checks into GitHub Actions.
Steps:
Open a PR that rewrites your TravisCI checks as GHAs (GitHub Actions). Delete all Travis-related files (
.travis/
and/or.travis.yml
).If your organization has self-hosted GHA runners, then make sure your check is configured to use those instead of GitHub’s hosted runners. (edXers: This applies to you; ask your eSRE if you need help.)
The correct conventional commit type for this change is
build:
Review the PR, ensuring that the new GitHub Actions pass.
Make it so TravisCI checks are no longer required (requires repository admin access):
In your repository, go to repo Settings → Branches → Branch Protection Rules.
Edit the default branch ("master" or “main”).
Scroll to "Require status checks before merging".
Delete "Travis CI" from required checks
Add in any new GitHub actions checks. They may not be available yet -- if so, we'll address this in a later step.
Save
Refresh the PR page. The build should now be green.
Merge the PR.
Make it so GHA checks are required (requries repository admin access):
Go back to Settings → Branches → Branch Protection Rules → (default branch) → Require status checks before merging.
Add in any new GitHub actions checks that weren't available before merging.
Save.
Optional: Reduce your repository's attack surface area by removing TravisCI’s access to it (requires organization-level admin access – edXers: Ask your eSRE to do this.):
In your GitHub organization, go to Settings → Installed GitHub Apps.
Configure Travis CI.
Under “Only Select Repositories”, remove the repository that you just switched over to GHA.
Save.