-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (32 loc) · 967 Bytes
/
build.yml
File metadata and controls
34 lines (32 loc) · 967 Bytes
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
name: Build project
on: [ push ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Build project
uses: eskatos/gradle-command-action@v1
with:
arguments: clean build
- uses: docker/setup-buildx-action@v2
- name: Build docker image
uses: docker/build-push-action@v3
with:
context: .
load: true
tags: simple-server:v1.0
- name: Test
run: |
docker run -d --name simple-server -p 8080:8080 -e GREETING_NAME=Alex simple-server:v1.0
# wait for container ready
sleep 30
greeting=$(curl -s http://localhost:8080)
if [ "$greeting" != "Hello, Alex" ]; then
echo "Expected [Hello, Alex], but greeting from docker [$greeting] doesn't macthes"
exit 1
fi