Merge branch 'bytebase:main' into main #59
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 CI image | |
on: | |
push: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Extract build args | |
run: | | |
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 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
file: scripts/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
tags: bytebase/bytebase:release-ci | |
build-args: | | |
RELEASE=release | |
VERSION_SUFFIX=-release-ci | |
GIT_COMMIT=${{ env.GITHUB_SHA }} | |
BUILD_TIME=${{ env.BUILD_TIME }} | |
BUILD_USER=${{ env.BUILD_USER }} | |
- name: Image digest | |
run: echo "Successfully pushed bytebase/bytebase:release-ci " ${{ steps.docker_build.outputs.digest }} |