publish-builder.yaml 2.0 KB
Newer Older
1 2 3 4 5 6 7 8
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:
9
      - 'build/docker/builder/**'
10 11 12 13
      - '.github/workflows/publish-builder.yaml'
  pull_request:
    # file paths to consider in the event. Optional; defaults to all.
    paths:
14
      - 'build/docker/builder/**'
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
      - '.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
32
        uses: reviewdog/action-hadolint@v1.16.1
33 34 35
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          reporter: github-pr-check # Default is github-pr-check
36
          hadolint_ignore: DL3008 SC1091 DL3013 DL3003
37 38 39
      - name: Get version from system time after release step
        id: extracter
        run: echo "::set-output name=version::$(date +%Y%m%d-%H%M%S)"
40 41 42
      - name: Docker Pull
        shell: bash
        run: |
43
          docker-compose pull --ignore-pull-failures ubuntu
44 45 46
      - name: Docker Build
        shell: bash
        run: |
47
          DATE_VERSION=${{ steps.extracter.outputs.version }} docker-compose build ubuntu
48
          DATE_VERSION=latest docker-compose build ubuntu
49
      - name: Docker Push
Q
quicksilver 已提交
50
        if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus'
51 52 53 54 55
        continue-on-error: true
        shell: bash
        run: |
          docker login -u ${{ secrets.DOCKERHUB_USER }} \
                       -p ${{ secrets.DOCKERHUB_TOKEN }}
56
          DATE_VERSION=${{ steps.extracter.outputs.version }} docker-compose push ubuntu
57
          DATE_VERSION=latest docker-compose push ubuntu