fix: desc (#3567) #76
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: OpenMLDB Docker | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/openmldb-docker.yml | |
- demo/**/* | |
tags: | |
- v* | |
pull_request: | |
paths: | |
- .github/workflows/openmldb-docker.yml | |
- demo/**/* | |
workflow_dispatch: | |
inputs: | |
OPENMLDB_VERSION: | |
description: 'The openmldb version installed in docker. ex: 0.3.0' | |
required: true | |
default: '0.5.0' | |
env: | |
IMAGE_NAME: openmldb | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Docker Compose Test | |
working-directory: demo | |
run: | | |
docker-compose -f docker-compose.test.yml -- up --exit-code-from sut | |
- name: Decide Push | |
run: | | |
if [[ ${{ github.event_name }} = 'workflow_dispatch' ]]; then | |
echo "PUSH=true" >> $GITHUB_ENV | |
VERSION=${{ github.event.inputs.OPENMLDB_VERSION }} | |
DOCKERHUB_TAG=${{ secrets.DOCKERHUB_REPO }}/$IMAGE_NAME:$VERSION | |
DOCKERHUB_LATEST=${{ secrets.DOCKERHUB_REPO }}/$IMAGE_NAME:latest | |
echo "DockerHub Tag: $DOCKERHUB_TAG" | |
echo "COMMIT=${{ github.sha }}" | |
echo "DOCKERHUB_TAG=$DOCKERHUB_TAG" >> $GITHUB_ENV | |
echo "DOCKERHUB_LATEST=$DOCKERHUB_LATEST" >> $GITHUB_ENV | |
else | |
echo "PUSH=false" >> $GITHUB_ENV | |
fi | |
- name: Login to Docker Hub | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build And Push | |
id: docker_build | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
uses: docker/build-push-action@v3 | |
with: | |
context: demo | |
push: ${{ env.PUSH }} | |
platforms: linux/amd64 | |
tags: | | |
${{ env.DOCKERHUB_TAG }} | |
${{ env.DOCKERHUB_LATEST }} | |
build-args: OPENMLDB_VERSION=${{ github.event.inputs.OPENMLDB_VERSION }} |