Skip to content

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

feat: add GitHub Actions workflow to build Cloud Docker image (#19741)

Danny Xu939b329a9d4f
diff --git a/.github/workflows/build-push-cloud-image.yml b/.github/workflows/build-push-cloud-image.yml
new file mode 100644
index 0000000000..a600baa27c
--- /dev/null
+++ b/.github/workflows/build-push-cloud-image.yml
@@ -0,0 +1,53 @@
+name: Build and Push Cloud Image to GAR
+
+on:
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+env:
+ GAR_LOCATION: us-central1
+ GAR_REPOSITORY: bytebase
+ IMAGE_NAME: bytebase-cloud
+
+jobs:
+ build-and-push:
+ runs-on: depot-ubuntu-24.04-arm-4
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+
+ - name: Extract build args
+ run: |
+ echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
+
+ - name: Set up Cloud SDK
+ uses: google-github-actions/setup-gcloud@v3
+ with:
+ project_id: ${{ secrets.GCP_PROJECT_ID }}
+
+ - name: Authenticate to Google Cloud
+ uses: google-github-actions/auth@v3
+ with:
+ credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
+
+ - name: Configure Docker for Artifact Registry
+ run: |
+ gcloud auth configure-docker ${{ env.GAR_LOCATION }}-docker.pkg.dev
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Build and push Docker image
+ uses: docker/build-push-action@v6
+ with:
+ context: .
+ file: scripts/Dockerfile
+ push: true
+ tags: |
+ ${{ 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=release