-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (36 loc) · 997 Bytes
/
docker-image.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
name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkoutcode
uses: actions/checkout@v3
- name: Build docker with new method
uses: isbang/[email protected]
with:
compose-file: "docker-compose.yml"
down-flags: "--volumes"
services: |
web
- name: Check the website status
run: |
ls -a
echo "Sleeping for 45 seconds"
sleep 45
docker ps -a
if curl -s http://localhost:5000/ | grep "Login to UofT Event"
then
echo "Login page detected. PR can be merged!"
else
echo "Login page not detected. PR can't be allowed to merge!"
exit 1
fi
- name: Check the unit tests status
run: |
echo "Running unit tests"
docker exec -i web-server bash -c "cd /tests && python -m pytest"