Skip to content

Commit

Permalink
🏗️ config(cd): Do ci:test:deploy in `ci:build:image:.
Browse files Browse the repository at this point in the history
This fixes #900 and fixes #1110.
  • Loading branch information
make-github-pseudonymous-again committed Feb 8, 2025
1 parent 8ef8136 commit 4789ce3
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 104 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/ci:build:image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,79 @@ jobs:
- name: Stop
run: |
docker compose down
test-deploy:
name: Continuous integration (test deploy)

needs:
- build

strategy:
matrix:
platform:
- ubuntu-latest
port:
- 3000
- 3123

runs-on: ${{ matrix.platform }}

timeout-minutes: 15

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Start
env:
ROOT_URL: http://localhost:${{ matrix.port }}
PORT: ${{ matrix.port }}
IMAGE_TAG: sha-${{ github.sha }}
run: |
docker compose \
--env-file .env -f compose.yaml \
--env-file .deploy/ghcr.io/.env -f .deploy/ghcr.io/compose.yaml \
up --no-build --detach
- id: patient-db-container
uses: ./.github/actions/docker/compose/container
with:
service: patient-db

- name: Wait for database container to be healthy
uses: ./.github/actions/docker/container/is-healthy
with:
container: ${{ steps.patient-db-container.outputs.id }}
timeout: 60

- name: Wait for web port to be available
uses: ./.github/actions/network/is-reachable
with:
timeout: 60
port: ${{ matrix.port }}

- id: patient-web-container
uses: ./.github/actions/docker/compose/container
with:
service: patient-web

- name: Wait for web container to be healthy
uses: ./.github/actions/docker/container/is-healthy
with:
container: ${{ steps.patient-web-container.outputs.id }}
timeout: 60

- name: Call healthcheck endpoint
run: |
timeout 60 bash -c \
'curl -f http://localhost:${{ matrix.port }}/api/healthcheck'
- name: Run healthcheck script
run: |
timeout 60 bash -c \
'node scripts/healthcheck.cjs http://localhost:${{ matrix.port }}/api/healthcheck'
- name: Stop
run: |
docker compose down
104 changes: 0 additions & 104 deletions .github/workflows/ci:test:deploy.yml

This file was deleted.

0 comments on commit 4789ce3

Please sign in to comment.