milvus/.github/workflows/publish-test-images.yaml
quicksilver 0626e4ac48
Update publish-test-images.yaml (#5672)
Signed-off-by: quicksilver <zhifeng.zhang@zilliz.com>
2021-06-08 17:27:58 +08:00

56 lines
2.1 KiB
YAML

name: Publish Test 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:
- 'tests/docker/Dockerfile'
- 'tests/python_test/requirements.txt'
- '.github/workflows/publish-test-images.yaml'
pull_request:
# file paths to consider in the event. Optional; defaults to all.
paths:
- 'tests/docker/Dockerfile'
- 'tests/python_test/requirements.txt'
- '.github/workflows/publish-test-images.yaml'
jobs:
publish-pytest-images:
name: PyTest
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: tests/docker
run: |
docker-compose pull --ignore-pull-failures pytest
IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker-compose build pytest
IMAGE_TAG=latest docker-compose build pytest
- name: Docker Push
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus'
continue-on-error: true
shell: bash
working-directory: tests/docker
run: |
docker login -u ${{ secrets.DOCKERHUB_USER }} \
-p ${{ secrets.DOCKERHUB_TOKEN }}
IMAGE_TAG=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} docker-compose push pytest
IMAGE_TAG=latest docker-compose push pytest
echo "Push pytest image Succeeded"