cherrypick: [release/2.16.0] fix: column does not exist (#11927) #1196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and push release image | |
on: | |
push: | |
branches: | |
# Run on pushing branches like `release/1.0.0` | |
- "release/*.*.*" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-release-image: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract build args | |
# Extract version from branch name | |
# Example: branch name `release/1.0.0` sets up env.RELEASE_VERSION=1.0.0 | |
run: | | |
echo "RELEASE_VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV | |
echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
echo "BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV | |
echo "BUILD_USER=$(id -u -n)" >> $GITHUB_ENV | |
- uses: pnpm/action-setup@v3.0.0 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.12.2" | |
cache: pnpm | |
cache-dependency-path: "frontend/pnpm-lock.yaml" | |
- run: pnpm install --frozen-lockfile | |
working-directory: frontend | |
- name: Run pnpm release build | |
run: | | |
cp backend/plugin/advisor/config/* frontend/src/types | |
cp backend/enterprise/api/plan.yaml frontend/src/types | |
export BB_GIT_COMMIT_ID_FE=${{ env.GIT_COMMIT }} | |
pnpm --dir ./frontend i && pnpm --dir ./frontend release | |
- 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: bytebase_build | |
uses: depot/build-push-action@v1 | |
with: | |
context: . | |
project: ${{ secrets.DEPOT_PROJECT}} | |
token: ${{ secrets.DEPOT_TOKEN }} | |
file: scripts/Dockerfile.depot | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: bytebase/bytebase:${{ env.RELEASE_VERSION }} | |
build-args: | | |
VERSION=${{ env.RELEASE_VERSION }} | |
GIT_COMMIT=${{ env.GIT_COMMIT }} | |
BUILD_TIME=${{ env.BUILD_TIME }} | |
BUILD_USER=${{ env.BUILD_USER }} | |
- name: Image digest | |
run: echo "Successfully pushed bytebase/bytebase:${{ env.RELEASE_VERSION }} ${{ steps.bytebase_build.outputs.digest }}" |