Add publish-krte-images.yaml (#5179)

* Add publish-krte-images.yaml

Signed-off-by: quicksilver <zhifeng.zhang@zilliz.com>

* Update publish-krte-images.yaml

Signed-off-by: quicksilver <zhifeng.zhang@zilliz.com>
pull/5180/head
quicksilver 2021-05-11 19:28:29 +08:00 committed by GitHub
parent 1c8717c2a3
commit 9e848b184e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,51 @@
name: Publish KRTE Images
# TODO: do not trigger action for some document file update
# This workflow is triggered on pushes or pull request to the repository.
on:
push:
# file paths to consider in the event. Optional; defaults to all.
paths:
- 'build/docker/krte/**'
- '.github/workflows/publish-krte-images.yaml'
pull_request:
# file paths to consider in the event. Optional; defaults to all.
paths:
- 'build/docker/krte/**'
- '.github/workflows/publish-krte-images.yaml'
jobs:
publish-krte-images:
name: KRTE
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check Dockerfile
uses: reviewdog/action-hadolint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check # Default is github-pr-check
hadolint_ignore: DL3008 SC1091 DL3013 DL3003
- name: Get version from system time after release step
id: extracter
run: |
echo "::set-output name=version::$(date +%Y%m%d)"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Docker Build
shell: bash
working-directory: build/docker/krte
run: |
export TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}
docker build --build-arg IMAGE_ARG="milvusdb/krte:$TAG" --build-arg GO_VERSION=1.15.8 -t "milvusdb/krte:$TAG" .
- name: Docker Push
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus'
continue-on-error: true
shell: bash
run: |
docker login -u ${{ secrets.DOCKERHUB_USER }} \
-p ${{ secrets.DOCKERHUB_TOKEN }}
export TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}
docker push "milvusdb/krte:$TAG"
echo "Push krte image Succeeded"