Skip to content

Commit 29f30a3

Browse files
committed
u
1 parent 337d5f7 commit 29f30a3

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/release-action.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Rollout using bytebase-action image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- test-cd-action-1
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Build app and upload
16+
run: |
17+
echo "Building..."
18+
echo "Build done!"
19+
echo "Uploading..."
20+
echo "Upload done!"
21+
deploy-to-all:
22+
needs: build
23+
runs-on: ubuntu-latest # use self-hosted machines if your Bytebase runs in internal networks.
24+
outputs:
25+
bytebase-plan: ${{ steps.create-plan.outputs.plan }}
26+
deployment-required: ${{ steps.create-plan.outputs.deployment-required }}
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
- name: rollout
31+
uses: docker://bytebase/bytebase-action:latest
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
BYTEBASE_URL: https://demo.bytebase.com
35+
BYTEBASE_SERVICE_ACCOUNT: [email protected]
36+
BYTEBASE_SERVICE_ACCOUNT_SECRET: ${{secrets.BYTEBASE_SERVICE_ACCOUNT_SECRET}}
37+
BYTEBASE_PROJECT: "projects/project-sample"
38+
BYTEBASE_TARGETS: "instances/prod-sample-instance/databases/hr_prod"
39+
BYTEBASE_TARGET_STAGE: environments/test
40+
FILE_PATTERN: "migrations/*.sql"
41+
with:
42+
entrypoint: bytebase-action
43+
args: 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="$HOME/bytebase-metadata.json"
44+
- name: Check output
45+
run: |
46+
echo "Output: ${{ runner.temp }}/bytebase-metadata.json"
47+
cat ${{ runner.temp }}/bytebase-metadata.json

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and push release image
1+
name: Rollout
22

33
on:
44
push:

0 commit comments

Comments
 (0)