Skip to content

Commit 851d90d

Browse files
committed
GitLab migration guide edit
1 parent 598977a commit 851d90d

File tree

2 files changed

+58
-53
lines changed

2 files changed

+58
-53
lines changed

content/actions/learn-github-actions/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ versions:
3737
{% link_with_intro /sharing-workflows-with-your-organization %}
3838
{% link_with_intro /security-hardening-for-github-actions %}
3939
{% link_with_intro /migrating-from-circleci-to-github-actions %}
40-
{% link_with_intro /migrating-from-gitlab-to-github-actions %}
40+
{% link_with_intro /migrating-from-gitlab-cicd-to-github-actions %}
4141
{% link_with_intro /migrating-from-azure-pipelines-to-github-actions %}
4242
{% link_with_intro /migrating-from-jenkins-to-github-actions %}

content/actions/learn-github-actions/migrating-from-gitlab-to-github-actions.md renamed to content/actions/learn-github-actions/migrating-from-gitlab-cicd-to-github-actions.md

Lines changed: 57 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Migrating from GitLab to GitHub Actions
3-
intro: '{% data variables.product.prodname_actions %} and GitLab share several configuration similarities, which makes migrating to {% data variables.product.prodname_actions %} relatively straightforward.'
2+
title: Migrating from GitLab CI/CD to GitHub Actions
3+
intro: '{% data variables.product.prodname_actions %} and GitLab CI/CD share several configuration similarities, which makes migrating to {% data variables.product.prodname_actions %} relatively straightforward.'
44
versions:
55
free-pro-team: '*'
66
enterprise-server: '>=2.22'
@@ -11,31 +11,31 @@ versions:
1111

1212
### Introduction
1313

14-
GitLab and {% data variables.product.prodname_actions %} both allow you to create workflows that automatically build, test, publish, release, and deploy code. GitLab and {% data variables.product.prodname_actions %} share some similarities in workflow configuration:
14+
GitLab CI/CD and {% data variables.product.prodname_actions %} both allow you to create workflows that automatically build, test, publish, release, and deploy code. GitLab CI/CD and {% data variables.product.prodname_actions %} share some similarities in workflow configuration:
1515

1616
- Workflow configuration files are written in YAML and are stored in the code's repository.
1717
- Workflows include one or more jobs.
1818
- Jobs include one or more steps or individual commands.
19-
- Jobs can run on both managed or on self-hosted machines.
19+
- Jobs can run on either managed or self-hosted machines.
2020

21-
There are a few differences, and this article will guide you to important differences so that you can easily migrate your workflow to GitHub Actions.
21+
There are a few differences, and this guide will show you the important differences so that you can migrate your workflow to {% data variables.product.prodname_actions %}.
2222

2323
### Jobs
2424

25-
Jobs in GitLab are very similar to jobs in {% data variables.product.prodname_actions %}. In both systems, jobs have the following characteristics:
25+
Jobs in GitLab CI/CD are very similar to jobs in {% data variables.product.prodname_actions %}. In both systems, jobs have the following characteristics:
2626

2727
* Jobs contain a series of steps or scripts that run sequentially.
28-
* Jobs run on separate virtual machines or in separate containers. [ need to check]
28+
* Jobs can run on separate machines or in separate containers.
2929
* Jobs run in parallel by default, but can be configured to run sequentially.
3030

31-
You can run a script or a shell command in a job. In GitLab, script steps are specified using the `script` key. In {% data variables.product.prodname_actions %}, all scripts are specified using the `run` key.
31+
You can run a script or a shell command in a job. In GitLab CI/CD, script steps are specified using the `script` key. In {% data variables.product.prodname_actions %}, all scripts are specified using the `run` key.
3232

3333
Below is an example of the syntax for each system:
3434

3535
<table class="d-block">
3636
<tr>
3737
<th>
38-
GitLab
38+
GitLab CI/CD
3939
</th>
4040
<th>
4141
{% data variables.product.prodname_actions %}
@@ -48,7 +48,7 @@ GitLab
4848
job1:
4949
variables:
5050
GIT_CHECKOUT: "true"
51-
script:
51+
script:
5252
- echo "Run your script here"
5353
```
5454
{% endraw %}
@@ -69,17 +69,17 @@ jobs:
6969
7070
### Runners
7171
72-
Runners are machines on which the jobs run. Both GitLab and {% data variables.product.prodname_actions %} offers managed and self-hosted variants of runners. In GitLab, `tags` are used to run jobs on different platforms while the same is done in {% data variables.product.prodname_actions %} with a `runs-on` key.
72+
Runners are machines on which the jobs run. Both GitLab CI/CD and {% data variables.product.prodname_actions %} offer managed and self-hosted variants of runners. In GitLab CI/CD, `tags` are used to run jobs on different platforms, while in {% data variables.product.prodname_actions %} it is done with the `runs-on` key.
7373

74-
Below is an example of the syntax for each system.
74+
Below is an example of the syntax for each system:
7575

7676
<table>
7777
<tr>
7878
<th>
79-
GitLab
79+
GitLab CI/CD
8080
</th>
8181
<th>
82-
GitHub Actions
82+
{% data variables.product.prodname_actions %}
8383
</th>
8484
</tr>
8585
<tr>
@@ -118,16 +118,18 @@ linux_job:
118118
</tr>
119119
</table>
120120

121-
### Docker Images
121+
For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)."
122+
123+
### Docker images
122124

123-
Both GitLab and {% data variables.product.prodname_actions %} support running steps inside of a Docker image. In GitLab, docker images are defined with a `image` key while in GitHub Actions, the same can be done with a `container` key.
125+
Both GitLab CI/CD and {% data variables.product.prodname_actions %} support running jobs in a Docker image. In GitLab CI/CD, Docker images are defined with a `image` key, while in {% data variables.product.prodname_actions %} it is done with the `container` key.
124126

125127
Below is an example of the syntax for each system:
126128

127129
<table class="d-block">
128130
<tr>
129131
<th>
130-
GitLab
132+
GitLab CI/CD
131133
</th>
132134
<th>
133135
{% data variables.product.prodname_actions %}
@@ -154,18 +156,18 @@ jobs:
154156
</tr>
155157
</table>
156158

157-
For more information, see "[Syntax for Containers](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontainer)."
159+
For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontainer)."
158160

159-
### Conditionals and Expression syntax
161+
### Condition and expression syntax
160162

161-
GitLab uses `rules` to determine if the job will or will not run for a specific condition. GitHub Actions provide a `if` keyword to prevent a job from running unless a condition is met.
163+
GitLab CI/CD uses `rules` to determine if a job will run for a specific condition. {% data variables.product.prodname_actions %} uses the `if` keyword to prevent a job from running unless a condition is met.
162164

163165
Below is an example of the syntax for each system:
164166

165167
<table class="d-block">
166168
<tr>
167169
<th>
168-
GitLab
170+
GitLab CI/CD
169171
</th>
170172
<th>
171173
{% data variables.product.prodname_actions %}
@@ -189,9 +191,10 @@ deploy_prod:
189191
```yaml
190192
jobs:
191193
deploy_prod:
192-
if: contains( github.ref, 'master' )
194+
if: contains( github.ref, 'master')
195+
runs-on: ubuntu-latest
193196
steps:
194-
- run: echo "Deply to production server"
197+
- run: echo "Deply to production server"
195198
```
196199
{% endraw %}
197200
</td>
@@ -202,14 +205,14 @@ For more information, see "[Context and expression syntax for {% data variables.
202205

203206
### Dependencies between Jobs
204207

205-
Both GitLab and {% data variables.product.prodname_actions %} allow you to set dependencies for a job. In both systems, jobs run in parallel by default, but job dependencies can be specified explicitly with the `needs` key. GitLab also has a concept of `stages`, where jobs in a stage run concurrently, but the next stage will kick in once all the jobs in the previous stage has completed. You can easily recreate this scenario in GitHub Actions with the `needs` keys.
208+
Both GitLab CI/CD and {% data variables.product.prodname_actions %} allow you to set dependencies for a job. In both systems, jobs run in parallel by default, but job dependencies in {% data variables.product.prodname_actions %} can be specified explicitly with the `needs` key. GitLab CI/CD also has a concept of `stages`, where jobs in a stage run concurrently, but the next stage will start when all the jobs in the previous stage have completed. You can recreate this scenario in {% data variables.product.prodname_actions %} with the `needs` key.
206209

207-
Below is an example of the syntax for each system. The workflows start with two jobs named `build_a` and `build_b`, and when these jobs complete, another job called `test_ab` will run. Finally, when this job complete, the job `deploy` will run.
210+
Below is an example of the syntax for each system. The workflows start with two jobs named `build_a` and `build_b` running in parallel, and when those jobs complete, another job called `test_ab` will run. Finally, when `test_ab` completes, the `deploy_ab` job will run.
208211

209212
<table class="d-block">
210213
<tr>
211214
<th>
212-
GitLab
215+
GitLab CI/CD
213216
</th>
214217
<th>
215218
{% data variables.product.prodname_actions %}
@@ -237,10 +240,10 @@ build_b:
237240
test_ab:
238241
stage: test
239242
script:
240-
- echo "This job will run after build_a and buil_b have finished."
243+
- echo "This job will run after build_a and build_b have finished."
241244
242245
deploy_ab:
243-
stage: test
246+
stage: deploy
244247
script:
245248
- echo "This job will run after test_ab is complete"
246249
```
@@ -264,44 +267,46 @@ jobs:
264267
runs-on: ubuntu-latest
265268
needs: [build_a,build_b]
266269
steps:
267-
- run: echo "This job will run after build_a and buil_b have finished"
270+
- run: echo "This job will run after build_a and build_b have finished"
268271
269272
deploy_ab:
270273
runs-on: ubuntu-latest
271274
needs: [test_ab]
272275
steps:
273-
- run: echo "This job will run after test_ab is complete"
276+
- run: echo "This job will run after test_ab is complete"
274277
```
275278
{% endraw %}
276279
</td>
277280
</tr>
278281
</table>
279282

280-
### Scheduled Jobs
283+
For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds)."
281284

282-
Both GitLab and {% data variables.product.prodname_actions %} allow you to run workflows at a specific interval. In GitLab, pipeline schedules are configured with a UI, while in GitHub Actions, you can trigger a workflow on the scheduled interval with the "on" key.
285+
### Scheduling workflows
283286

284-
For more information, see "[Scheduled events](/actions/reference/events-that-trigger-workflows#scheduled-events)."
287+
Both GitLab CI/CD and {% data variables.product.prodname_actions %} allow you to run workflows at a specific interval. In GitLab CI/CD, pipeline schedules are configured with the UI, while in {% data variables.product.prodname_actions %} you can trigger a workflow on a scheduled interval with the "on" key.
285288

286-
### Variables and Secrets
289+
For more information, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#scheduled-events)."
287290

288-
GitLab and {% data variables.product.prodname_actions %} support setting environment variables in the configuration file and creating secrets using the GitLab or {% data variables.product.product_name %} UI.
291+
### Variables and secrets
289292

290-
For more information, see "[Using environment variables](/actions/configuring-and-managing-workflows/using-environment-variables)" and "[Creating and using encrypted secrets](/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)."
293+
GitLab CI/CD and {% data variables.product.prodname_actions %} support setting environment variables in the pipeline or workflow configuration file, and creating secrets using the GitLab or {% data variables.product.product_name %} UI.
294+
295+
For more information, see "[Environment variables](/actions/reference/environment-variables)" and "[Encrypted secrets](/actions/reference/encrypted-secrets)."
291296

292297
### Caching
293298

294-
GitLab and {% data variables.product.prodname_actions %} provide a method to manually cache files in the configuration file.
299+
GitLab CI/CD and {% data variables.product.prodname_actions %} provide a method in the configuration file to manually cache workflow files.
295300

296-
Below is an example of the syntax for each system.
301+
Below is an example of the syntax for each system:
297302

298303
<table class="d-block">
299304
<tr>
300305
<th>
301-
GitLab
306+
GitLab CI/CD
302307
</th>
303308
<th>
304-
GitHub Actions
309+
{% data variables.product.prodname_actions %}
305310
</th>
306311
</tr>
307312
<tr>
@@ -341,21 +346,21 @@ jobs:
341346
</tr>
342347
</table>
343348

344-
For more information, see "[Caching dependencies to speed up workflows](/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows)."
349+
For more information, see "[Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows)."
345350

346351
### Artifacts
347352

348-
Both GitLab and {% data variables.product.prodname_actions %} provide `artifacts` to upload files and directories created by the job. In {% data variables.product.prodname_actions %}, artifacts can be used to persist data across multiple jobs.
353+
Both GitLab CI/CD and {% data variables.product.prodname_actions %} can upload files and directories created by a job as artifacts. In {% data variables.product.prodname_actions %}, artifacts can be used to persist data across multiple jobs.
349354

350-
Below is an example of the syntax for each system.
355+
Below is an example of the syntax for each system:
351356

352357
<table>
353358
<tr>
354359
<th>
355-
GitLab
360+
GitLab CI/CD
356361
</th>
357362
<th>
358-
GitHub Actions
363+
{% data variables.product.prodname_actions %}
359364
</th>
360365
</tr>
361366
<tr>
@@ -383,23 +388,23 @@ artifacts:
383388
</tr>
384389
</table>
385390

386-
For more information, see "[Persisting workflow data using artifacts](/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts)."
391+
For more information, see "[Storing workflow data as artifacts](/actions/guides/storing-workflow-data-as-artifacts)."
387392

388-
### Databases and Service containers
393+
### Databases and service containers
389394

390395
Both systems enable you to include additional containers for databases, caching, or other dependencies.
391396

392-
In GitLab, primary containers are specified with a `image` key while {% data variables.product.prodname_actions %} use `container` key for primary containers. In both system additional containers can be specificed with `services` key.
397+
In GitLab CI/CD, a container for the job is specified with the `image` key, while {% data variables.product.prodname_actions %} uses the `container` key. In both systems, additional service containers are specified with the `services` key.
393398

394-
Below is an example in GitLab and {% data variables.product.prodname_actions %} configuration syntax.
399+
Below is an example of the syntax for each system:
395400

396401
<table class="d-block">
397402
<tr>
398403
<th>
399-
GitLab
404+
GitLab CI/CD
400405
</th>
401406
<th>
402-
GitHub Actions
407+
{% data variables.product.prodname_actions %}
403408
</th>
404409
</tr>
405410
<tr>
@@ -468,4 +473,4 @@ jobs:
468473
</tr>
469474
</table>
470475
471-
For more information, see "[About service containers](/actions/configuring-and-managing-workflows/about-service-containers)."
476+
For more information, see "[About service containers](/actions/guides/about-service-containers)."

0 commit comments

Comments
 (0)