mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
Print Docker container log, if success or failure healthcheck
This commit is contained in:
parent
e511d6aecf
commit
88875a3375
12
.github/workflows/main-docker.yml
vendored
12
.github/workflows/main-docker.yml
vendored
@ -66,8 +66,10 @@ jobs:
|
|||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Run the container in the background
|
- name: Validate container run output
|
||||||
run: docker run -d --rm --name trilium_local ${{ env.TEST_TAG }}
|
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
|
- name: Wait for the healthchecks to pass
|
||||||
uses: stringbean/docker-healthcheck-action@v1
|
uses: stringbean/docker-healthcheck-action@v1
|
||||||
@ -77,6 +79,12 @@ jobs:
|
|||||||
require-status: running
|
require-status: running
|
||||||
require-healthy: true
|
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:
|
build:
|
||||||
name: Build Docker images
|
name: Build Docker images
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
Loading…
x
Reference in New Issue
Block a user