-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.56 KB
/
build.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
name: samples
on:
push:
branches:
- master
- release-*
tags:
- v*
pull_request:
branches:
- master
- release-*
jobs:
build:
name: Build and push docker images
runs-on: ubuntu-latest
env:
SAMPLE_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
steps:
- uses: actions/checkout@v1
- name: Parse release version and set REL_VERSION
run: python ./.github/scripts/get_release_version.py
- name: Build docker image
run: |
if [ -z "${{ env.SAMPLE_REGISTRY }}" ]; then
export SAMPLE_REGISTRY=docker.io/dapriosamples
echo "##[set-env name=SAMPLE_REGISTRY;]$SAMPLE_REGISTRY"
fi
SAMPLE_LIST=(2.hello-kubernetes 3.distributed-calculator 4.pub-sub 5.bindings 7.middleware 8.observability)
for sample in "${SAMPLE_LIST[@]}"; do
echo "Building image for ${sample}..."
pushd ${sample}
make build
popd
done
- name: docker login
if: github.event_name != 'pull_request'
run: |
docker login -u ${{ secrets.DOCKER_REGISTRY_ID }} -p ${{ secrets.DOCKER_REGISTRY_PASS }}
- name: publish image to dockerhub
if: github.event_name != 'pull_request'
run: |
SAMPLE_LIST=(2.hello-kubernetes 3.distributed-calculator 4.pub-sub 5.bindings 7.middleware 8.observability)
for sample in "${SAMPLE_LIST[@]}"; do
echo "Push image for ${sample}..."
pushd ${sample}
make push
popd
done