You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/tutorials/github-release-cicd-workflow.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Database Release CI/CD with GitHub Action
2
+
title: Database Release CI/CD with GitHub Actions
3
3
author: Ningjing
4
4
updated_at: 2025/02/17 18:00
5
5
tags: Tutorial
@@ -16,7 +16,7 @@ This tutorial demonstrates how to automate database release CI/CD using GitHub A
16
16
- Automatically create releases in Bytebase after merging to the `main` branch and roll out to the database
17
17
- Manually rollout the release to the database by stage (for **Pro or Enterprise plan**)
18
18
19
-
While this guide uses GitHub Actions, the same principles can be applied to other CI/CD platforms like GitLab CI, Bitbucket Pipelines, or Azure DevOps using the Bytebase API.
19
+
While this guide uses GitHub Actions, the same principles can be applied to other platforms like GitLab CI, Bitbucket Pipelines, or Azure DevOps using the Bytebase API.
20
20
21
21
<HintBlocktype="info">
22
22
@@ -56,10 +56,10 @@ If you have **Enterprise Plan**, you can create a **Custom Role** for the servic
56
56
57
57
## Step 3 - Fork the Example Repository and Configure Variables
58
58
59
-
1.Go to the [bytebase-release-cicd-workflows-example](https://github.com/bytebase/release-cicd-workflows-example) repository and fork it. There are two workflows in this repository:
59
+
1.Fork [bytebase/release-cicd-workflows-example](https://github.com/bytebase/release-cicd-workflows-example). There are two workflows in this repository:
60
60
61
-
-`.github/workflows/bytebase-check-release.yml`: Check the release SQL syntax when there's a pull request.
62
-
-`.github/workflows/bytebase-release-cicd.yml`: Create a release in Bytebase when there's a merge to the `main` branch.
61
+
-`.github/workflows/bytebase-check-release.yml`: [Lint the SQL](/docs/sql-review/overview/) migration files after the PR is created.
62
+
-`.github/workflows/bytebase-release-cicd.yml`: Create a release in Bytebase after the PR is merged to the `main` branch.
63
63
64
64
1. Go into `.github/workflows/bytebase-release-cicd.yml` and `.github/workflows/bytebase-check-release.yml`. In the `env` section, replace the variable values with your own and commit the changes.
65
65
@@ -134,7 +134,7 @@ To create migration files to trigger release creation, the files have to match t
1. Check out your repo and log in to Bytebase to gain the access token.
140
140
@@ -152,7 +152,7 @@ To create migration files to trigger release creation, the files have to match t
152
152
153
153
1. The **create_release** step scans the files matching the pattern and collects them into a bundle. Note that these files should also obey the naming scheme mentioned above.
154
154
155
-
The bundle is first sent to check. If the check passes, a release is then created on Bytebase.
155
+
The bundle is first sent for check. Because we set `FAIL_ON_ERROR`, the release will be created in Bytebase only when the check passes.
156
156
157
157
```yaml
158
158
- name: Create release
@@ -199,12 +199,12 @@ To create migration files to trigger release creation, the files have to match t
199
199
200
200
These are the steps:
201
201
202
-
-create the plan from the release
203
-
-check the plan
204
-
-create the rollout
205
-
-wait for the rollout to complete
202
+
- Create the plan from the release
203
+
- Check the plan
204
+
- Create the rollout
205
+
- Wait for the rollout to complete
206
206
207
-
In the **create_plan** step, you can set check-plan to FAIL_ON_ERROR to fail the action if plan checks report errors. Use SKIP to skip plan checks. Use FAIL_ON_WARNING to fail the action if plan checks report warning.
207
+
In the **create_plan** step, you can set check-plan to `FAIL_ON_ERROR `to fail the action if plan checks report errors. Use `SKIP` to skip plan checks. Use `FAIL_ON_WARNING` to fail the action if plan checks report warning.
208
208
209
209
The rollout pipeline stages are created on demand in the **wait_rollout** step. You can use target-stage to early exit the step. When the target stage completes, it exits. If target-stage is not provided or not found, wait_rollout will wait until all stages complete. The target-stage is a stage title in the deployment config in the project setting.
0 commit comments