Siva
Siva

Reputation: 123

GitLab to GitHub

Can we use an existing gitlab.yml file as it as in github for CI? Will the CI pipeline work if I migrate my entire repo from Gitlab to GitHub? Or I should write the .yml file anew? I am completely new to this.

Upvotes: 2

Views: 2715

Answers (4)

MosQuan
MosQuan

Reputation: 140

For now you can tune gitlab and github to use same .gitlab-ci.yml
Using GitLab CI/CD with a GitHub repository however it available only with premium and ultimate tiers.

Upvotes: 0

DevGo
DevGo

Reputation: 1078

This could be tale question, but this might help for others who is looking for on the go solution for this pipeline migration in ease.

https://docs.github.com/en/actions/migrating-to-github-actions/automated-migrations/migrating-from-gitlab-with-github-actions-importer

This will extract all the dependent items as well for the pipeline yaml in actions yaml.

Initially configure the values in environment as following https://docs.github.com/en/actions/migrating-to-github-actions/automated-migrations/migrating-from-gitlab-with-github-actions-importer#configuring-credentials.

Make sure you have all the required access and tokens from both GitLAb and GitHub as well.

This audit will let you know the consolidation of all repos inside a project group https://docs.github.com/en/actions/migrating-to-github-actions/automated-migrations/migrating-from-gitlab-with-github-actions-importer#perform-an-audit-of-gitlab

And finally you can dry run it to receive the yaml to be adopt to GitHub Actions. You need to provide it to GitHub manually under the path for actions yaml.

Upvotes: 0

navedrizv
navedrizv

Reputation: 481

No, .gitlab-ci.yaml will not work on Github. You will have to create Github Workflows.

This should help you with the migration https://docs.github.com/en/actions/migrating-to-github-actions/migrating-from-gitlab-cicd-to-github-actions

Upvotes: 0

peterevans
peterevans

Reputation: 42140

GitLab CI/CD is not compatible with GitHub Actions. You will need to write a new workflow. The following are some resources to get you started.

GitHub Actions Starter Workflows : This is a good place to start to get a base working example for the workflow you need.

GitHub Actions Official Documentation

GitHub Actions on the Marketplace : There are lots of useful 3rd party actions that you can freely use in your workflows.

Upvotes: 3

Related Questions