fix: repair deploy pipeline — boolean type and unterminated quoted string
- Changed no_cache input type from boolean to string (Gitea 1.26.3 compat) - Fixed multi-line double-quoted string in DEPLOYSCRIPT heredoc - Hardened inputs.* references with proper short-circuit fallbacks
This commit is contained in:
@@ -41,10 +41,10 @@ on:
|
||||
default: ''
|
||||
type: string
|
||||
no_cache:
|
||||
description: 'Disable Docker build cache'
|
||||
description: 'Disable Docker build cache (true/false)'
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
default: 'false'
|
||||
type: string
|
||||
git_ref:
|
||||
description: 'Git ref to deploy (branch, tag, or commit SHA; default: main)'
|
||||
required: false
|
||||
@@ -212,13 +212,14 @@ jobs:
|
||||
set -euo pipefail
|
||||
|
||||
# Auto-deploy: always use cache. Manual: respect no_cache input.
|
||||
NO_CACHE="${{ github.event_name == 'workflow_dispatch' && inputs.no_cache || false }}"
|
||||
BUILD_ARGS=""
|
||||
if [ "$NO_CACHE" = "true" ]; then
|
||||
SERVICE_ARG=""
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
if [ "${{ github.event_name == 'workflow_dispatch' && inputs.no_cache || 'false' }}" = "true" ]; then
|
||||
BUILD_ARGS="--no-cache"
|
||||
fi
|
||||
|
||||
SERVICE_ARG="${{ github.event_name == 'workflow_dispatch' && inputs.service || '' }}"
|
||||
fi
|
||||
|
||||
# Write the deploy script to a file to avoid nested quoting issues
|
||||
cat > /tmp/nexus-deploy-script.sh << 'DEPLOYSCRIPT'
|
||||
@@ -235,13 +236,9 @@ docker rm -f nexus-postgres-1 nexus-api-1 nexus-web-1 2>/dev/null || true
|
||||
PG_VOL=$(docker volume ls -q --filter name=nexus-postgres 2>/dev/null | head -1)
|
||||
if [ -n "$PG_VOL" ]; then
|
||||
echo "Checking postgres WAL integrity..."
|
||||
docker run --rm -v "$PG_VOL:/var/lib/postgresql/data" \
|
||||
--entrypoint sh postgres:17-alpine -c "
|
||||
echo 'Resetting WAL...'
|
||||
pg_resetwal -f /var/lib/postgresql/data && echo 'WAL reset OK'
|
||||
" 2>&1 || echo 'pg_resetwal failed (may be benign)'
|
||||
docker run --rm -v "$PG_VOL:/var/lib/postgresql/data" --entrypoint sh postgres:17-alpine -c "pg_resetwal -f /var/lib/postgresql/data && echo 'WAL reset OK'" 2>&1 || echo "pg_resetwal failed (may be benign)"
|
||||
else
|
||||
echo 'Postgres volume not found - will be created fresh'
|
||||
echo "Postgres volume not found - will be created fresh"
|
||||
fi
|
||||
|
||||
BUILD_ARGS="${DEPLOY_BUILD_ARGS:-}"
|
||||
|
||||
Reference in New Issue
Block a user