2021-05-11 19:28:29 +08:00
|
|
|
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:
|
2021-12-10 11:07:08 +08:00
|
|
|
workflow_dispatch:
|
2021-05-11 19:28:29 +08:00
|
|
|
push:
|
|
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
|
|
paths:
|
|
|
|
- 'build/docker/krte/**'
|
|
|
|
- '.github/workflows/publish-krte-images.yaml'
|
2021-07-09 14:08:00 +08:00
|
|
|
- '!**.md'
|
2021-05-11 19:28:29 +08:00
|
|
|
pull_request:
|
|
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
|
|
paths:
|
|
|
|
- 'build/docker/krte/**'
|
|
|
|
- '.github/workflows/publish-krte-images.yaml'
|
2021-07-09 14:08:00 +08:00
|
|
|
- '!**.md'
|
2021-05-11 19:28:29 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish-krte-images:
|
|
|
|
name: KRTE
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 60
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- 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
|
2021-12-13 19:32:16 +08:00
|
|
|
if: success() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' )&& github.repository == 'milvus-io/milvus'
|
2021-05-11 19:28:29 +08:00
|
|
|
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"
|
2021-07-22 11:46:32 +08:00
|
|
|
- name: Update KRTE Image Changes
|
2021-12-13 19:32:16 +08:00
|
|
|
if: success() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && github.repository == 'milvus-io/milvus'
|
2021-07-22 11:46:32 +08:00
|
|
|
continue-on-error: true
|
|
|
|
shell: bash
|
|
|
|
working-directory: build/ci/jenkins/pod
|
|
|
|
run: |
|
|
|
|
export TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}
|
2021-12-14 09:17:09 +08:00
|
|
|
sed -i "s#krte:.*#krte:${TAG}#g" ./build/ci/jenkins/pod/rte.yaml
|
2021-07-22 11:46:32 +08:00
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
2021-12-14 18:19:09 +08:00
|
|
|
git add rte.yaml
|
2021-07-22 11:46:32 +08:00
|
|
|
git commit -m "Update KRTE image changes"
|
|
|
|
- name: Create Pull Request
|
|
|
|
id: cpr
|
2021-12-13 19:32:16 +08:00
|
|
|
if: success() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && github.repository == 'milvus-io/milvus'
|
2021-07-22 11:46:32 +08:00
|
|
|
continue-on-error: true
|
|
|
|
uses: peter-evans/create-pull-request@v3
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }}
|
|
|
|
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
|
|
|
signoff: false
|
|
|
|
branch: update_krte_${{ github.sha }}
|
|
|
|
delete-branch: true
|
|
|
|
title: '[automated] Update KRTE image changes'
|
|
|
|
body: |
|
|
|
|
Update KRTE image changes
|
|
|
|
|
|
|
|
Signed-off-by: ${{ github.actor }} ${{ github.actor }}@users.noreply.github.com
|
|
|
|
- name: Check outputs
|
2021-12-13 19:32:16 +08:00
|
|
|
if: success() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && github.repository == 'milvus-io/milvus'
|
2021-07-22 11:46:32 +08:00
|
|
|
run: |
|
|
|
|
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
|
|
|
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|