This repository has been archived by the owner on Nov 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (52 loc) · 2.07 KB
/
publish-docker.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
name: build-docker-images
on:
push:
branches:
- master
watch:
types: [started]
# TODO: create generic job for build jobs
jobs:
build_proxy:
name: Build proxy image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get change count for proxy
id: filesChanged
# TODO: do this better
run: |
echo "::set-output name=grepValue::$( git diff --name-only ${{ github.event.before }}..${{ github.sha }} | grep -c '^proxy' )"
echo "::set-output name=count::$( if [ -z ${{ steps.filesChanged.outputs.grepValue }} ]; then echo 0; else echo ${{ steps.filesChanged.outputs.grepValue }}; fi )"
- name: Build and push proxy
if: steps.filesChanged.outputs.count > 0 || github.actor == 'shotor'
uses: docker/build-push-action@v1
with:
username: ${{ secrets.docker_hub_user }}
password: ${{ secrets.docker_hub_key }}
repository: tihunlp/tihu-proxy
tag_with_ref: true
dockerfile: proxy/Dockerfile
path: ${{ github.workspace }}/proxy
build_mock_api:
name: Build mock api image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get change count for mock
id: filesChanged
run: |
echo "::set-output name=grepValue::$( git diff --name-only ${{ github.event.before }}..${{ github.sha }} | grep -c '^grpc' )"
echo "::set-output name=count::$( if [ -z ${{ steps.filesChanged.outputs.grepValue }} ]; then echo 0; else echo ${{ steps.filesChanged.outputs.grepValue }}; fi )"
- name: Build and push proxy
if: steps.filesChanged.outputs.count > 0 || github.actor == 'shotor'
uses: docker/build-push-action@v1
with:
username: ${{ secrets.docker_hub_user }}
password: ${{ secrets.docker_hub_key }}
repository: tihunlp/tihu-mock-api
tag_with_ref: true
dockerfile: grpc/Dockerfile
path: ${{ github.workspace }}/grpc