-
Notifications
You must be signed in to change notification settings - Fork 105
97 lines (80 loc) · 2.31 KB
/
ticket-api.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
name: Build Ticket API Image
on:
push:
paths:
- ticket-api/**
- .github/workflows/ticket-api*.yml
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
services:
mysql:
image: mysql
env:
MYSQL_ROOT_PASSWORD: password
ports:
- 4306:3306
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
zookeeper:
image: confluentinc/cp-zookeeper:latest
env:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-kafka:latest
ports:
- 29092:29092
- 9092:9092
env:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set Up Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache gradle dependencies
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
- name: Build
run: ./gradlew verifierStubsJar :ticket-api:build :ticket-api:bootJar -PskipInfraSetup -Dorg.gradle.daemon=false --rerun-tasks
- name: Upload Jar File
uses: actions/upload-artifact@v1
with:
name: ticket-api-jar
path: ticket-api/build/libs
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
dockerfile: ./ticket-api/Dockerfile
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ticket-api
push: true
tags: lemiorhan/hexagonaldemo-ticketapi:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}