17
17
echo "Build done!"
18
18
echo "Uploading..."
19
19
echo "Upload done!"
20
- deploy_to_test :
20
+ deploy-to-test :
21
21
needs : build
22
22
runs-on : ubuntu-latest # use self-hosted machines if your Bytebase runs in internal networks.
23
23
environment : test
@@ -26,12 +26,12 @@ jobs:
26
26
BYTEBASE_SERVICE_ACCOUNT :
[email protected]
27
27
BYTEBASE_PROJECT : " projects/project-sample"
28
28
# The Bytebase rollout pipeline will deploy to 'test' and 'prod' environments.
29
- # 'deploy_to_test ' job rollouts the 'test' stage and 'deploy_to_prod ' job rollouts the 'prod' stage.
29
+ # 'deploy-to-test ' job rollouts the 'test' stage and 'deploy-to-prod ' job rollouts the 'prod' stage.
30
30
BYTEBASE_TARGETS : " instances/test-sample-instance/databases/hr_test,instances/prod-sample-instance/databases/hr_prod"
31
31
FILE_PATTERN : " migrations/*.sql"
32
32
outputs :
33
- bytebase_plan : ${{ steps.create_plan .outputs.plan }}
34
- deployment_required : ${{ steps.create_plan .outputs.deployment-required }}
33
+ bytebase-plan : ${{ steps.create-plan .outputs.plan }}
34
+ deployment-required : ${{ steps.create-plan .outputs.deployment-required }}
35
35
steps :
36
36
- name : Checkout
37
37
uses : actions/checkout@v4
43
43
service-key : ${{ env.BYTEBASE_SERVICE_ACCOUNT }}
44
44
service-secret : ${{secrets.BYTEBASE_SERVICE_ACCOUNT_SECRET}} # Please use secrets for sensitive data in production.
45
45
- name : Create release
46
- id : create_release
46
+ id : create-release
47
47
uses : bytebase/create-release-action@v1
48
48
with :
49
49
url : ${{ env.BYTEBASE_URL }}
@@ -55,36 +55,36 @@ jobs:
55
55
targets : ${{ env.BYTEBASE_TARGETS }}
56
56
validate-only : false
57
57
- name : Create plan
58
- id : create_plan
58
+ id : create-plan
59
59
uses : bytebase/create-plan-from-release-action@v1
60
60
with :
61
61
url : ${{ env.BYTEBASE_URL }}
62
62
token : ${{ steps.login.outputs.token }}
63
63
project : ${{ env.BYTEBASE_PROJECT }}
64
- release : ${{ steps.create_release .outputs.release }}
64
+ release : ${{ steps.create-release .outputs.release }}
65
65
targets : ${{ env.BYTEBASE_TARGETS }}
66
66
check-plan : " SKIP"
67
67
- name : Rollout
68
68
id : rollout
69
69
uses : bytebase/rollout-action@v1
70
- if : ${{ steps.create_plan .outputs.deployment-required == 'true' }}
70
+ if : ${{ steps.create-plan .outputs.deployment-required == 'true' }}
71
71
with :
72
72
url : ${{ env.BYTEBASE_URL }}
73
73
token : ${{ steps.login.outputs.token }}
74
- plan : ${{ steps.create_plan .outputs.plan }}
74
+ plan : ${{ steps.create-plan .outputs.plan }}
75
75
target-stage : test # the environment resource id.
76
76
- name : Deploy app
77
77
run : |
78
78
echo "Deploying app to test environment..."
79
79
echo "Deploy app to test environment done!"
80
80
deploy_to_prod :
81
- needs : deploy_to_test
81
+ needs : deploy-to-test
82
82
runs-on : ubuntu-latest
83
83
environment : prod
84
84
env :
85
85
BYTEBASE_URL : https://demo.bytebase.com
86
86
BYTEBASE_SERVICE_ACCOUNT :
[email protected]
87
- if : ${{ needs.deploy_to_test .outputs.deployment-required == 'true' }}
87
+ if : ${{ needs.deploy-to-test .outputs.deployment-required == 'true' }}
88
88
steps :
89
89
- name : Checkout
90
90
uses : actions/checkout@v4
@@ -101,7 +101,7 @@ jobs:
101
101
with :
102
102
url : ${{ env.BYTEBASE_URL }}
103
103
token : ${{ steps.login.outputs.token }}
104
- plan : ${{ needs.deploy_to_test .outputs.bytebase_plan }}
104
+ plan : ${{ needs.deploy-to-test .outputs.bytebase-plan }}
105
105
target-stage : prod # the environment resource id.
106
106
- name : Deploy app
107
107
run : |
0 commit comments