Skip to content

Commit 4967551

Browse files
ci: enable setting LOG_LEVEL
1 parent b8e663c commit 4967551

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

.github/workflows/api-deploy-rollback.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,23 @@ on:
88
description: 'Version Tag to rollback to'
99
required: true
1010
type: string
11+
logLevel:
12+
description: 'Log level for the deployment'
13+
default: info
14+
type: choice
15+
options:
16+
- trace
17+
- debug
18+
- info
19+
- warn
20+
- error
1121

1222
jobs:
1323
deploy:
1424
if: ${{ github.ref_name == 'main' }}
1525
uses: ./.github/workflows/reusable-api-deploy.yml
1626
with:
1727
tag: ${{ inputs.version }}
28+
logLevel: ${{ inputs.logLevel }}
1829
secrets:
1930
host: ${{ secrets.API_HOST }}

.github/workflows/reusable-api-deploy.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
description: 'Tag of Docker Image to deploy'
99
required: true
1010
type: string
11+
logLevel:
12+
description: 'Log level for the deployment'
13+
default: info
14+
type: string
1115
secrets:
1216
host:
1317
description: 'Remote host to deploy to'
@@ -81,7 +85,7 @@ jobs:
8185

8286
- name: Prepare .env for Compose
8387
run: |
84-
printf "IMAGE_NAME=%s\nIMAGE_TAG=%s\n" "${{ env.IMAGE_NAME }}" "${{ inputs.tag }}"> .env
88+
printf "IMAGE_NAME=%s\nIMAGE_TAG=%s\nLOG_LEVEL=%s\n" "${{ env.IMAGE_NAME }}" "${{ inputs.tag }}" "${{ inputs.logLevel }}" > .env
8589
shell: bash
8690

8791
- name: Copy files to remote server

api/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ services:
1111
- ./.env.app:/app/.env:ro
1212
# enclave key already on the server in sig/enclave-key.pem
1313
- ./sig/:/app/sig/:ro
14+
environment:
15+
- LOG_LEVEL=${LOG_LEVEL:-info}
1416
healthcheck:
1517
test: ['CMD', 'curl', '-f', 'http://localhost:3000/health']
1618
interval: 30s

0 commit comments

Comments
 (0)