Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: bytebase demo (#16840)

Danny Xu36f296895d22
diff --git a/.github/workflows/build-push-demo-image.yml b/.github/workflows/build-push-demo-image.yml
index d86c22fc9f..b7b0bb86bf 100644
--- a/.github/workflows/build-push-demo-image.yml
+++ b/.github/workflows/build-push-demo-image.yml
@@ -4,14 +4,13 @@ on:
workflow_dispatch:
env:
- GCP_PROJECT_ID: bytebase-saas-prod
GAR_LOCATION: us-central1
GAR_REPOSITORY: bytebase
IMAGE_NAME: bytebase-demo
jobs:
build-and-push:
- runs-on: depot-ubuntu-24.04-4
+ runs-on: depot-ubuntu-24.04-arm-8
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -23,7 +22,7 @@ jobs:
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
- project_id: ${{ env.GCP_PROJECT_ID }}
+ project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
@@ -44,8 +43,22 @@ jobs:
file: scripts/Dockerfile
push: true
tags: |
- ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPOSITORY }}/${{ env.IMAGE_NAME }}:latest
+ ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ env.GAR_REPOSITORY }}/${{ env.IMAGE_NAME }}:latest
build-args: |
VERSION=cloud
GIT_COMMIT=${{ env.GIT_COMMIT }}
- RELEASE=dev
\ No newline at end of file
+ RELEASE=dev
+
+ - name: Authenticate to Google Cloud
+ uses: google-github-actions/auth@v1
+ with:
+ credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
+
+ - name: Get GKE credentials
+ uses: google-github-actions/get-gke-credentials@v1
+ with:
+ cluster_name: ${{ secrets.GKE_CLUSTER_NAME }}
+ location: ${{ secrets.GKE_CLUSTER_LOCATION }}
+
+ - name: Restart deployment
+ run: kubectl rollout restart deployment/bytebase-demo --namespace website
\ No newline at end of file
diff --git a/.github/workflows/demo-daily-deploy.yml b/.github/workflows/demo-daily-deploy.yml
index 01cff24e69..2754dc051c 100644
--- a/.github/workflows/demo-daily-deploy.yml
+++ b/.github/workflows/demo-daily-deploy.yml
@@ -2,9 +2,22 @@ name: Demo Daily Deploy
on:
schedule:
- cron: '0 0 * * *'
+ workflow_dispatch:
+
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- - name: Trigger Deploy
- run: /usr/bin/curl https://api.render.com/deploy/srv-cqq0vm8gph6c7382o34g?key=mqDZc1p_NX4
+ - name: Authenticate to Google Cloud
+ uses: google-github-actions/auth@v1
+ with:
+ credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
+
+ - name: Get GKE credentials
+ uses: google-github-actions/get-gke-credentials@v1
+ with:
+ cluster_name: ${{ secrets.GKE_CLUSTER_NAME }}
+ location: ${{ secrets.GKE_CLUSTER_LOCATION }}
+
+ - name: Restart deployment
+ run: kubectl rollout restart deployment/bytebase-demo --namespace website
diff --git a/.github/workflows/docker-tag-latest.yml b/.github/workflows/docker-tag-latest.yml
index 98f0cff797..c276e51032 100644
--- a/.github/workflows/docker-tag-latest.yml
+++ b/.github/workflows/docker-tag-latest.yml
@@ -29,39 +29,3 @@ jobs:
echo version: ${RELEASE_VERSION}
docker buildx imagetools create -t registry.cn-shanghai.aliyuncs.com/bytebase/bytebase:latest bytebase/bytebase:${RELEASE_VERSION}
docker buildx imagetools create -t registry.cn-shanghai.aliyuncs.com/bytebase/bytebase:${RELEASE_VERSION} bytebase/bytebase:${RELEASE_VERSION}
-
- build-demo-image:
- runs-on: ubuntu-latest
- permissions:
- contents: read
- id-token: write
- steps:
- - uses: actions/checkout@v4
- - name: Extract build args
- # Extract version from branch name
- # Example: branch name `release/1.0.0` sets up env.IMAGE_VERSION=1.0.0
- run: |
- echo "VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV
- echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
- - name: Login to DockerHub
- uses: docker/login-action@v3
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
- - uses: depot/setup-action@v1
- - name: Build and push
- id: docker_build
- uses: depot/build-push-action@v1
- with:
- context: .
- project: ${{ secrets.DEPOT_PROJECT}}
- token: ${{ secrets.DEPOT_TOKEN }}
- file: scripts/Dockerfile
- platforms: linux/amd64
- push: true
- tags: |
- bytebase/website:demo
- build-args: |
- VERSION=${{ env.VERSION }}
- GIT_COMMIT=${{ env.GIT_COMMIT }}
- RELEASE=dev