Skip to content

Commit

Permalink
Merge pull request #431 from TriliumNext/perfectra1n-patch-2
Browse files Browse the repository at this point in the history
Print Docker container log, regardless of success or failure of healthcheck
  • Loading branch information
eliandoran authored Sep 15, 2024
2 parents 12543f7 + 88875a3 commit 7ca4cdd
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/main-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ jobs:
tags: ${{ env.TEST_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run the container in the background
run: docker run -d --rm --name trilium_local ${{ env.TEST_TAG }}


- name: Validate container run output
run: |
CONTAINER_ID=$(docker run -d --log-driver=journald --rm --name trilium_local ${{ env.TEST_TAG }})
echo "Container ID: $CONTAINER_ID"
- name: Wait for the healthchecks to pass
uses: stringbean/docker-healthcheck-action@v1
with:
Expand All @@ -77,6 +79,12 @@ jobs:
require-status: running
require-healthy: true

# Print the entire log of the container thus far, regardless if the healthcheck failed or succeeded
- name: Print entire log
if: always()
run: |
journalctl -u docker CONTAINER_NAME=trilium_local --no-pager
build:
name: Build Docker images
runs-on: ubuntu-latest
Expand Down

0 comments on commit 7ca4cdd

Please sign in to comment.