-
Notifications
You must be signed in to change notification settings - Fork 28
79 lines (76 loc) · 2.43 KB
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build and Push on Tag
# This workflow is triggered on new tag pushed to the repository.
on:
push:
tags:
- "*"
jobs:
publish-builder:
name: Publish Builder
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu18.04]
env:
OS_NAME: ${{ matrix.os }}
REGISTRY_NAME: milvusdb/milvus-operator
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get version from system time after release step
id: extracter
run: |
echo "::set-output name=git_tag::$(echo "${{ github.ref }}" | awk -F '/' '{print $3}')"
# TODO: add go mod cache
# - name: Cache Go Mod Volumes
# uses: actions/cache@v1
# with:
# path: .docker/go-mod
# key: go-mod-${{ hashFiles('**/go.sum') }}
# restore-keys: go-mod-
- name: Build Docker Image
shell: bash
run: |
IMAGE_TAG=${{ steps.extracter.outputs.git_tag }}
echo "Start Building ${REGISTRY_NAME}:${IMAGE_TAG}"
docker build -t ${REGISTRY_NAME}:${IMAGE_TAG} .
docker tag ${REGISTRY_NAME}:${IMAGE_TAG} ${REGISTRY_NAME}:latest
- name: Push Docker Image
shell: bash
run: |
IMAGE_TAG=${{ steps.extracter.outputs.git_tag }}
docker login -u ${{ secrets.MILVUSDB_DOCKER_USER }} \
-p ${{ secrets.MILVUSDB_DOCKER_PWD }}
docker push ${REGISTRY_NAME}:${IMAGE_TAG}
docker push ${REGISTRY_NAME}:latest
tool-publish:
name: Tool Publish Builder
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu18.04]
env:
OS_NAME: ${{ matrix.os }}
REGISTRY_NAME: milvusdb/milvus-config-tool
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get version from system time after release step
id: extracter
run: |
echo "::set-output name=git_tag::$(echo "${{ github.ref }}" | awk -F '/' '{print $3}')"
- name: Build Docker Image
shell: bash
run: |
make docker-tool-build
- name: Push Docker Image
shell: bash
run: |
IMAGE_TAG=${{ steps.extracter.outputs.git_tag }}
docker login -u ${{ secrets.MILVUSDB_DOCKER_USER }} \
-p ${{ secrets.MILVUSDB_DOCKER_PWD }}
make docker-tool-push