Skip to content

Commit c073c46

Browse files
committed
fix: revert LNbits workflow to working version + deploy-lnbits.sh
Reverted workflow to the exact structure that was working before, only change: uses deploy-lnbits.sh instead of setup-droplet.sh for existing installs.
1 parent 7f3168b commit c073c46

File tree

1 file changed

+5
-31
lines changed

1 file changed

+5
-31
lines changed

.github/workflows/deploy-lnbits-droplet.yml

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ jobs:
1111
env:
1212
# Supports either secret or variable named ENV_FILE (dotenv format)
1313
ENV_FILE: ${{ secrets.ENV_FILE || vars.ENV_FILE }}
14-
# Direct secrets fallback (these may not be in ENV_FILE)
1514
DIRECT_SSH_KEY: ${{ secrets.LNBITS_DROPLET_SSH_KEY || secrets.LNBITS_DROP_SSH_KEY || vars.LNBITS_DROPLET_SSH_KEY || vars.LNBITS_DROP_SSH_KEY }}
16-
DIRECT_HOST: ${{ secrets.LNBITS_DROPLET_HOST || vars.LNBITS_DROPLET_HOST }}
17-
DIRECT_USER: ${{ secrets.LNBITS_DROPLET_USER || vars.LNBITS_DROPLET_USER }}
18-
DIRECT_ADMIN_KEY: ${{ secrets.LNBITS_ADMIN_KEY || vars.LNBITS_ADMIN_KEY }}
1915
steps:
2016
- name: Checkout
2117
uses: actions/checkout@v4
@@ -25,8 +21,8 @@ jobs:
2521
run: |
2622
set -euo pipefail
2723
if [ -z "${ENV_FILE:-}" ]; then
28-
echo "ENV_FILE is empty — relying on direct secrets only"
29-
exit 0
24+
echo "ENV_FILE is empty. Add secret/variable ENV_FILE with dotenv contents."
25+
exit 1
3026
fi
3127
3228
# Export KEY=VALUE lines into job env (ignore comments/blank lines)
@@ -43,24 +39,11 @@ jobs:
4339
} >> "$GITHUB_ENV"
4440
done <<< "$ENV_FILE"
4541
46-
- name: Resolve required vars
42+
- name: Validate required vars
4743
shell: bash
4844
run: |
4945
set -euo pipefail
50-
51-
# Resolve LNBITS_DROPLET_HOST — prefer ENV_FILE, fall back to direct secret
52-
if [ -z "${LNBITS_DROPLET_HOST:-}" ] && [ -n "${DIRECT_HOST:-}" ]; then
53-
echo "LNBITS_DROPLET_HOST=${DIRECT_HOST}" >> "$GITHUB_ENV"
54-
export LNBITS_DROPLET_HOST="${DIRECT_HOST}"
55-
fi
56-
57-
# Resolve LNBITS_DROPLET_USER — prefer ENV_FILE, fall back to direct secret
58-
if [ -z "${LNBITS_DROPLET_USER:-}" ] && [ -n "${DIRECT_USER:-}" ]; then
59-
echo "LNBITS_DROPLET_USER=${DIRECT_USER}" >> "$GITHUB_ENV"
60-
export LNBITS_DROPLET_USER="${DIRECT_USER}"
61-
fi
62-
63-
# Resolve SSH key — check ENV_FILE keys, then direct secret
46+
# Backward-compat aliases
6447
if [ -z "${LNBITS_DROPLET_SSH_KEY:-}" ] && [ -n "${LNBITS_DROP_SSH_KEY:-}" ]; then
6548
echo "LNBITS_DROPLET_SSH_KEY=${LNBITS_DROP_SSH_KEY}" >> "$GITHUB_ENV"
6649
export LNBITS_DROPLET_SSH_KEY="${LNBITS_DROP_SSH_KEY}"
@@ -72,21 +55,12 @@ jobs:
7255
export LNBITS_DROPLET_SSH_KEY="${DIRECT_SSH_KEY}"
7356
fi
7457
75-
# Resolve LNBITS_ADMIN_KEY
76-
if [ -z "${LNBITS_ADMIN_KEY:-}" ] && [ -n "${DIRECT_ADMIN_KEY:-}" ]; then
77-
echo "LNBITS_ADMIN_KEY=${DIRECT_ADMIN_KEY}" >> "$GITHUB_ENV"
78-
export LNBITS_ADMIN_KEY="${DIRECT_ADMIN_KEY}"
79-
fi
80-
81-
# Validate all required vars are set
8258
for k in LNBITS_DROPLET_HOST LNBITS_DROPLET_USER LNBITS_DROPLET_SSH_KEY LNBITS_ADMIN_KEY; do
8359
if [ -z "${!k:-}" ]; then
84-
echo "❌ Missing required var: $k"
85-
echo " Set it as a GitHub secret/variable, or include it in ENV_FILE"
60+
echo "Missing required ENV_FILE key: $k"
8661
exit 1
8762
fi
8863
done
89-
echo "✅ All required vars resolved"
9064
9165
- name: Deploy to LNbits host
9266
uses: appleboy/ssh-action@v1.0.3

0 commit comments

Comments
 (0)