File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,14 @@ jobs:
1818 echo "Build done!"
1919 echo "Uploading..."
2020 echo "Upload done!"
21- deploy-to-all :
21+ deploy-to-test :
2222 needs : build
2323 runs-on : ubuntu-latest # use self-hosted machines if your Bytebase runs in internal networks.
24+ environment : test
2425 container :
2526 image : docker://bytebase/bytebase-action:latest
2627 outputs :
27- bytebase-plan : ${{ steps.create-plan.outputs.plan }}
28- deployment-required : ${{ steps.create-plan.outputs.deployment-required }}
28+ bytebase-plan : ${{ steps.set-output.outputs.plan }}
2929 steps :
3030 - name : Checkout
3131 uses : actions/checkout@v4
4242 BYTEBASE_OUTPUT : ${{ runner.temp }}/bytebase-metadata.json
4343 run : |
4444 bytebase-action rollout --url=${{ env.BYTEBASE_URL }} --service-account=${{ env.BYTEBASE_SERVICE_ACCOUNT }} --service-account-secret=${{ env.BYTEBASE_SERVICE_ACCOUNT_SECRET }} --project=${{ env.BYTEBASE_PROJECT }} --file-pattern=${{ env.FILE_PATTERN }} --targets=${{ env.BYTEBASE_TARGETS }} --target-stage=${{ env.BYTEBASE_TARGET_STAGE }} --output=${{ env.BYTEBASE_OUTPUT }}
45- ls -al ${{ runner.temp }}
46- - name : Check output
45+ - name : Set output
46+ id : set- output
4747 run : |
48- ls -al ${{ runner.temp }}
49- echo "Output: ${{ runner.temp }}/bytebase-metadata.json"
50- cat ${{ runner.temp }}/bytebase-metadata.json
48+ PLAN=$(jq -r .plan ${{ runner.temp }}/bytebase-metadata.json)
49+ echo "plan=$PLAN" >> $GITHUB_OUTPUT
50+ deploy-to-prod :
51+ needs : deploy-to-test
52+ runs-on : ubuntu-latest
53+ environment : prod
54+ container :
55+ image : docker://bytebase/bytebase-action:latest
56+ steps :
57+ - name : Checkout
58+ uses : actions/checkout@v4
59+ - name : rollout
60+ env :
61+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
62+ run : |
63+ echo ${{ needs.deploy-to-test.outputs.bytebase-plan }}
You can’t perform that action at this time.
0 commit comments