diff --git a/.github/workflows/docker-compose.yml b/.github/workflows/docker-compose.yml new file mode 100644 index 00000000..6ab06b97 --- /dev/null +++ b/.github/workflows/docker-compose.yml @@ -0,0 +1,40 @@ +--- +# This is a github action to run docker-compose +# docker-compose.yml +# to run the docker build in the top level directory +# to run the docker build in the tests directory and run the tests with pytest +# docker-compose run --rm app pytest +on: + push: + branches: [ main ] + paths: + - 'docker-compose.yml' + - 'Dockerfile' + - 'tests/**' + - 'app/**' + - 'app.py' + - 'requirements.txt' + - 'README.md' + - '.github/workflows/**' + - '.github/workflows/docker-compose.yml' + - '.github/workflows/main.yml' + - '.github/workflows/python-app.yml' + - '.github/workflows/python-app.yml' + - '.github/workflows' + +name: Docker Compose + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Add your build and test steps here + + - name: Build and run docker services + run: | + docker-compose build + docker-compose up -d + docker-compose run --rm app pytest