-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,22 +8,10 @@ jobs: | |
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Build Docker image | ||
run: docker build --tag n8n-shortlink:ci . | ||
- name: Build test Docker image | ||
run: docker build --tag n8n-shortlink:test . | ||
|
||
# TODO: Replace `sleep 10` | ||
- name: Run Docker container | ||
- name: Run Docker container until health check | ||
run: | | ||
docker run --detach --publish 3001:3001 --name n8n-shortlink-ci n8n-shortlink:ci | ||
sleep 10 # wait for container to start up | ||
- name: Check health endpoint | ||
run: | | ||
response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3001/health) | ||
if [ $response -eq 200 ]; then | ||
echo "Health check passed" | ||
exit 0 | ||
else | ||
echo "Health check failed with status code: $response" | ||
exit 1 | ||
fi | ||
docker run --detach --publish 3001:3001 --name test-container n8n-shortlink:test | ||
timeout 20 bash -c 'until curl -s http://localhost:3001/health > /dev/null; do sleep 1; done' |