forked from yevgenykuz/service-discovery-demo-parent
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (114 loc) · 4.28 KB
/
java-cd.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Java CD
on:
push:
branches:
- master
paths:
- 'java-apps/**'
workflow_dispatch:
defaults:
run:
working-directory: java-apps
jobs:
build-and-deploy:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B install --file pom.xml
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Deploy bank-analysis
uses: docker/build-push-action@v2
with:
context: ./java-apps/bank-analysis
file: ./java-apps/bank-analysis/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/bank-analysis:latest
- name: Deploy bank-gateway
uses: docker/build-push-action@v2
with:
context: ./java-apps/bank-gateway
file: ./java-apps/bank-gateway/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/bank-gateway:latest
- name: Deploy bank-storage
uses: docker/build-push-action@v2
with:
context: ./java-apps/bank-storage
file: ./java-apps/bank-storage/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/bank-storage:latest
- name: Deploy java-kafka-entry-point
uses: docker/build-push-action@v2
with:
context: ./java-apps/java-kafka-entry-point
file: ./java-apps/java-kafka-entry-point/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/java-kafka-entry-point:latest
- name: Deploy java-kafka-http-entry-point
uses: docker/build-push-action@v2
with:
context: ./java-apps/java-kafka-http-entry-point
file: ./java-apps/java-kafka-http-entry-point/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/java-kafka-http-entry-point:latest
- name: Deploy java-kafka-propagator
uses: docker/build-push-action@v2
with:
context: ./java-apps/java-kafka-propagator
file: ./java-apps/java-kafka-propagator/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/java-kafka-propagator:latest
- name: Deploy java-kafka-sink
uses: docker/build-push-action@v2
with:
context: ./java-apps/java-kafka-sink
file: ./java-apps/java-kafka-sink/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/java-kafka-sink:latest
- name: Deploy java-rabbitmq-entry-point
uses: docker/build-push-action@v2
with:
context: ./java-apps/java-rabbitmq-entry-point
file: ./java-apps/java-rabbitmq-entry-point/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/java-rabbitmq-entry-point:latest
- name: Deploy java-rabbitmq-http-entry-point
uses: docker/build-push-action@v2
with:
context: ./java-apps/java-rabbitmq-http-entry-point
file: ./java-apps/java-rabbitmq-http-entry-point/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/java-rabbitmq-http-entry-point:latest
- name: Deploy java-rabbitmq-propagator
uses: docker/build-push-action@v2
with:
context: ./java-apps/java-rabbitmq-propagator
file: ./java-apps/java-rabbitmq-propagator/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/java-rabbitmq-propagator:latest
- name: Deploy java-rabbitmq-sink
uses: docker/build-push-action@v2
with:
context: ./java-apps/java-rabbitmq-sink
file: ./java-apps/java-rabbitmq-sink/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/java-rabbitmq-sink:latest