Split previous docker test CI into one for PRs and one for triggering the main buildx workflow that deploys new images to Docker Hub. Note that this needs to be further refactored soon to use reusable workflows. The main portion of docker/docker-compose tests is duplicated between the new main + test workflows.
26 lines
699 B
YAML
26 lines
699 B
YAML
name: docker_tests
|
|
|
|
on:
|
|
push:
|
|
branches: main
|
|
pull_request:
|
|
branches: main
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout code
|
|
uses: actions/checkout@v2
|
|
- name: build and test (docker)
|
|
run: |
|
|
docker build --tag whoogle-search:test .
|
|
docker run --publish 5000:5000 --detach --name whoogle-search-nocompose whoogle-search:test
|
|
sleep 15
|
|
docker exec whoogle-search-nocompose curl -f http://localhost:5000/healthz || exit 1
|
|
- name: build and test (docker-compose)
|
|
run: |
|
|
docker-compose up --detach
|
|
sleep 15
|
|
docker exec whoogle-search curl -f http://localhost:5000/healthz || exit 1
|