-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (37 loc) · 1.1 KB
/
docker-test.yml
File metadata and controls
44 lines (37 loc) · 1.1 KB
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
name: Docker Build Test
on:
pull_request:
paths:
- "**.js"
- "**.jsx"
- "**.ts"
- "**.tsx"
- "package.json"
- "package-lock.json"
- "Dockerfile"
- ".dockerignore"
- ".github/workflows/docker-test.yml"
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: "Build Docker Image"
run: |
docker build -t labconnect-frontend .
- name: "Run Docker Container"
run: |
docker run -d --name labconnect-frontend-container labconnect-frontend
sleep 30
docker logs labconnect-frontend-container
docker stop labconnect-frontend-container
- name: "Check for Container Exit Code"
id: check_exit_code
run: |
docker inspect labconnect-frontend-container --format='{{.State.ExitCode}}'
docker rm labconnect-frontend-container
- name: "Fail if Container Fails"
if: steps.check_exit_code.outputs.exit_code != '0'
run: exit 1