milvus/.github/workflows/publish-builder.yaml

58 lines
2.0 KiB
YAML
Raw Normal View History

name: Publish Builder
# 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/env/**'
- '.github/workflows/publish-builder.yaml'
pull_request:
# file paths to consider in the event. Optional; defaults to all.
paths:
- 'build/docker/env/**'
- '.github/workflows/publish-builder.yaml'
jobs:
publish-builder:
name: AMD64 Ubuntu ${{ matrix.ubuntu }}
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
ubuntu: [18.04]
env:
UBUNTU: ${{ matrix.ubuntu }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check Dockerfile
uses: reviewdog/action-hadolint@v1.16.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check # Default is github-pr-check
hadolint_ignore: DL3008
- name: Get version from system time after release step
id: extracter
run: echo "::set-output name=version::$(date +%Y%m%d-%H%M%S)"
- name: Docker Pull
shell: bash
run: |
docker-compose pull --ignore-pull-failures ubuntu
- name: Docker Build
shell: bash
run: |
DATE_VERSION=${{ steps.extracter.outputs.version }} docker-compose build ubuntu
DATE_VERSION=latest docker-compose build ubuntu
- name: Docker Push
if: success() && github.event_name == 'push' && github.repository == 'zilliztech/milvus-distributed'
continue-on-error: true
shell: bash
run: |
docker login -u ${{ secrets.DOCKERHUB_USER }} \
-p ${{ secrets.DOCKERHUB_TOKEN }}
DATE_VERSION=${{ steps.extracter.outputs.version }} docker-compose push ubuntu
DATE_VERSION=latest docker-compose push ubuntu