Refactor Docker CI workflows
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.main
parent
0b70962e0c
commit
6d178342ee
|
@ -2,7 +2,7 @@ name: buildx
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: ["docker_tests"]
|
workflows: ["docker_main"]
|
||||||
branches: [main]
|
branches: [main]
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
name: docker_main
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["tests"]
|
||||||
|
branches: [main]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
|
# TODO: Needs refactoring to use reusable workflows and share w/ docker_tests
|
||||||
|
jobs:
|
||||||
|
on-success:
|
||||||
|
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 whoogle-search:test
|
||||||
|
sleep 15
|
||||||
|
docker exec whoogle-search 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
|
|
@ -1,21 +1,25 @@
|
||||||
name: docker_tests
|
name: docker_tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
push:
|
||||||
workflows: ["tests"]
|
branches: main
|
||||||
branches: [main]
|
pull_request:
|
||||||
types:
|
branches: main
|
||||||
- completed
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
on-success:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout code
|
- name: checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: build and test
|
- name: build and test (docker)
|
||||||
run: |
|
run: |
|
||||||
docker build --tag whoogle-search:test .
|
docker build --tag whoogle-search:test .
|
||||||
docker run --publish 5000:5000 --detach --name whoogle-search 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
|
sleep 15
|
||||||
docker exec whoogle-search curl -f http://localhost:5000/healthz || exit 1
|
docker exec whoogle-search curl -f http://localhost:5000/healthz || exit 1
|
||||||
|
|
Loading…
Reference in New Issue