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:
18
18
echo "Build done!"
19
19
echo "Uploading..."
20
20
echo "Upload done!"
21
- deploy-to-all :
21
+ deploy-to-test :
22
22
needs : build
23
23
runs-on : ubuntu-latest # use self-hosted machines if your Bytebase runs in internal networks.
24
+ environment : test
24
25
container :
25
26
image : docker://bytebase/bytebase-action:latest
26
27
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 }}
29
29
steps :
30
30
- name : Checkout
31
31
uses : actions/checkout@v4
42
42
BYTEBASE_OUTPUT : ${{ runner.temp }}/bytebase-metadata.json
43
43
run : |
44
44
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
47
47
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