mirror of
https://github.com/benbusby/whoogle-search.git
synced 2026-01-24 20:57:17 -05:00
- Upgraded `actions/checkout` from v2 to v4 for better performance. - Replaced deprecated buildx setup with `docker/setup-qemu-action` and `docker/setup-buildx-action`. - Updated `docker/login-action` to v3 for enhanced security. - Refined conditions for building and pushing Docker images based on workflow events.
30 lines
965 B
YAML
30 lines
965 B
YAML
name: docker_main
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["tests"]
|
|
branches: [main, updates]
|
|
types:
|
|
- completed
|
|
|
|
# TODO: Needs refactoring to use reusable workflows and share w/ docker_tests
|
|
jobs:
|
|
on-success:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
steps:
|
|
- name: checkout code
|
|
uses: actions/checkout@v4
|
|
- 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 rm -f whoogle-search-nocompose
|
|
WHOOGLE_IMAGE="whoogle-search:test" docker compose up --detach
|
|
sleep 15
|
|
docker exec whoogle-search curl -f http://localhost:5000/healthz || exit 1
|