Skip to content

bytebase/rollout-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ed27a0e · Jan 20, 2025

History

13 Commits
Jan 13, 2025
Jan 13, 2025
Jan 13, 2025
Jan 13, 2025
Jan 13, 2025
Jan 17, 2025
Jan 13, 2025
Jan 17, 2025
Jan 13, 2025
Jan 13, 2025
Jan 13, 2025
Jan 13, 2025
Jan 13, 2025
Jan 13, 2025
Jan 13, 2025
Jan 13, 2025
Jan 20, 2025
Jan 20, 2025
Jan 13, 2025
Jan 20, 2025
Jan 13, 2025
Jan 13, 2025

Repository files navigation

About

Github action to rollout on Bytebase.

Example

on:
  push:
    branches:
      - main

jobs:
  bytebase-cicd:
    runs-on: ubuntu-latest
    env:
      BYTEBASE_URL: 'https://demo.bytebase.com'
      BYTEBASE_PROJECT: 'projects/example'
      BYTEBASE_SERVICE_ACCOUNT: '[email protected]'
      BYTEBASE_TARGETS: 'instances/mysql1/databases/db1,instances/mysql1/databases/db2'
    name: Bytebase cicd
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Login to Bytebase
        id: login
        uses: bytebase/login-action@main
        with:
          url: ${{ env.BYTEBASE_URL }}
          service-account: ${{ env.BYTEBASE_SERVICE_ACCOUNT }}
          service-account-key: ${{ secrets.BYTEBASE_PASSWORD }}
      - name: Create release
        id: create_release
        uses: bytebase/create-release-action@main
        with:
          url: ${{ env.BYTEBASE_URL }}
          token: ${{ steps.login.outputs.token }}
          project: ${{ env.BYTEBASE_PROJECT }}
          file-pattern: 'migrations/*.sql'
      - name: Create plan
        id: create_plan
        uses: bytebase/create-plan-from-release-action@main
        with:
          url: ${{ env.BYTEBASE_URL }}
          token: ${{ steps.login.outputs.token }}
          project: ${{ env.BYTEBASE_PROJECT }}
          release: ${{ steps.create_release.outputs.release }}
          targets: ${{ env.BYTEBASE_TARGETS }}
      - name: rollout
        id: rollout
        uses: bytebase/rollout-action@main
        with:
          url: ${{ env.BYTEBASE_URL }}
          token: ${{ steps.login.outputs.token }}
          plan: ${{ steps.create_plan.outputs.plan }}