Dev hp main deployment #248
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |
elasticsearch | |
web | |
- name: Check the website status | |
run: | | |
ls -a | |
echo "Sleeping for 60 seconds" | |
sleep 45 | |
docker ps -a | |
if curl -s http://localhost:5000/ | grep "Login to UofT Event Hub" | |
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" | |