-
Notifications
You must be signed in to change notification settings - Fork 17
38 lines (32 loc) · 872 Bytes
/
build.yml
File metadata and controls
38 lines (32 loc) · 872 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
35
36
37
38
name: Build project
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# TODO build project
- 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