1717 echo "Build done!"
1818 echo "Uploading..."
1919 echo "Upload done!"
20- deploy_to_test :
20+ deploy-to-test :
2121 needs : build
2222 runs-on : ubuntu-latest # use self-hosted machines if your Bytebase runs in internal networks.
2323 environment : test
@@ -26,12 +26,12 @@ jobs:
2626 BYTEBASE_SERVICE_ACCOUNT :
[email protected] 2727 BYTEBASE_PROJECT : " projects/project-sample"
2828 # 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.
3030 BYTEBASE_TARGETS : " instances/test-sample-instance/databases/hr_test,instances/prod-sample-instance/databases/hr_prod"
3131 FILE_PATTERN : " migrations/*.sql"
3232 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 }}
3535 steps :
3636 - name : Checkout
3737 uses : actions/checkout@v4
4343 service-key : ${{ env.BYTEBASE_SERVICE_ACCOUNT }}
4444 service-secret : ${{secrets.BYTEBASE_SERVICE_ACCOUNT_SECRET}} # Please use secrets for sensitive data in production.
4545 - name : Create release
46- id : create_release
46+ id : create-release
4747 uses : bytebase/create-release-action@v1
4848 with :
4949 url : ${{ env.BYTEBASE_URL }}
@@ -55,36 +55,36 @@ jobs:
5555 targets : ${{ env.BYTEBASE_TARGETS }}
5656 validate-only : false
5757 - name : Create plan
58- id : create_plan
58+ id : create-plan
5959 uses : bytebase/create-plan-from-release-action@v1
6060 with :
6161 url : ${{ env.BYTEBASE_URL }}
6262 token : ${{ steps.login.outputs.token }}
6363 project : ${{ env.BYTEBASE_PROJECT }}
64- release : ${{ steps.create_release .outputs.release }}
64+ release : ${{ steps.create-release .outputs.release }}
6565 targets : ${{ env.BYTEBASE_TARGETS }}
6666 check-plan : " SKIP"
6767 - name : Rollout
6868 id : rollout
6969 uses : bytebase/rollout-action@v1
70- if : ${{ steps.create_plan .outputs.deployment-required == 'true' }}
70+ if : ${{ steps.create-plan .outputs.deployment-required == 'true' }}
7171 with :
7272 url : ${{ env.BYTEBASE_URL }}
7373 token : ${{ steps.login.outputs.token }}
74- plan : ${{ steps.create_plan .outputs.plan }}
74+ plan : ${{ steps.create-plan .outputs.plan }}
7575 target-stage : test # the environment resource id.
7676 - name : Deploy app
7777 run : |
7878 echo "Deploying app to test environment..."
7979 echo "Deploy app to test environment done!"
8080 deploy_to_prod :
81- needs : deploy_to_test
81+ needs : deploy-to-test
8282 runs-on : ubuntu-latest
8383 environment : prod
8484 env :
8585 BYTEBASE_URL : https://demo.bytebase.com
8686 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' }}
8888 steps :
8989 - name : Checkout
9090 uses : actions/checkout@v4
@@ -101,7 +101,7 @@ jobs:
101101 with :
102102 url : ${{ env.BYTEBASE_URL }}
103103 token : ${{ steps.login.outputs.token }}
104- plan : ${{ needs.deploy_to_test .outputs.bytebase_plan }}
104+ plan : ${{ needs.deploy-to-test .outputs.bytebase-plan }}
105105 target-stage : prod # the environment resource id.
106106 - name : Deploy app
107107 run : |
0 commit comments