2020-11-02 10:42:09 +08:00
|
|
|
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:
|
2021-04-27 19:27:50 +08:00
|
|
|
- 'build/docker/builder/**'
|
2020-11-02 10:42:09 +08:00
|
|
|
- '.github/workflows/publish-builder.yaml'
|
2021-07-09 14:08:00 +08:00
|
|
|
- '!**.md'
|
2020-11-02 10:42:09 +08:00
|
|
|
pull_request:
|
|
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
|
|
paths:
|
2021-04-27 19:27:50 +08:00
|
|
|
- 'build/docker/builder/**'
|
2020-11-02 10:42:09 +08:00
|
|
|
- '.github/workflows/publish-builder.yaml'
|
2021-07-09 14:08:00 +08:00
|
|
|
- '!**.md'
|
2020-11-02 10:42:09 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish-builder:
|
2021-07-08 15:43:45 +08:00
|
|
|
name: AMD64 ${{ matrix.os }}
|
2020-11-02 10:42:09 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 60
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-07-08 16:35:28 +08:00
|
|
|
os: [ubuntu18.04, centos7]
|
2020-11-02 10:42:09 +08:00
|
|
|
env:
|
2021-07-08 15:43:45 +08:00
|
|
|
OS_NAME: ${{ matrix.os }}
|
2021-07-12 22:47:08 +08:00
|
|
|
GITHUB_TOKEN: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }}
|
2020-11-02 10:42:09 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-11-02 18:49:11 +08:00
|
|
|
- name: Get version from system time after release step
|
|
|
|
id: extracter
|
2021-07-09 11:59:09 +08:00
|
|
|
run: echo "::set-output name=version::$(date +%Y%m%d)"
|
2020-11-17 15:06:48 +08:00
|
|
|
- name: Docker Pull
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2021-07-08 16:35:28 +08:00
|
|
|
DATE_VERSION=latest docker-compose pull --ignore-pull-failures builder
|
2020-11-02 10:42:09 +08:00
|
|
|
- name: Docker Build
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2021-07-08 16:35:28 +08:00
|
|
|
DATE_VERSION=latest docker-compose build builder
|
|
|
|
DATE_VERSION=${{ steps.extracter.outputs.version }} docker-compose build builder
|
2020-11-02 10:42:09 +08:00
|
|
|
- name: Docker Push
|
2021-04-26 13:59:28 +08:00
|
|
|
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus'
|
2020-11-02 10:42:09 +08:00
|
|
|
continue-on-error: true
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
docker login -u ${{ secrets.DOCKERHUB_USER }} \
|
|
|
|
-p ${{ secrets.DOCKERHUB_TOKEN }}
|
2021-07-08 16:35:28 +08:00
|
|
|
DATE_VERSION=latest docker-compose push builder
|
|
|
|
DATE_VERSION=${{ steps.extracter.outputs.version }} docker-compose push builder
|
2021-07-12 17:06:18 +08:00
|
|
|
- name: Update Builder Image Changes
|
|
|
|
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus'
|
|
|
|
continue-on-error: true
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
sed -i "s#DATE_VERSION=.*#DATE_VERSION=${{ steps.extracter.outputs.version }}#g" .env
|
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
|
|
|
git add .env
|
|
|
|
git commit -m "Update Builder Image Changes"
|
|
|
|
- name: Push Builder Image Changes
|
2021-07-12 17:28:14 +08:00
|
|
|
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu18.04'
|
2021-07-12 17:06:18 +08:00
|
|
|
continue-on-error: true
|
2021-07-12 18:11:32 +08:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2021-07-12 22:47:08 +08:00
|
|
|
git push "https://github.com/$GITHUB_REPOSITORY.git" HEAD:${{ github.ref }} --follow-tags
|