Skip to content

Commit 3bd8fb9

Browse files
committed
min-rebranding
1 parent 6247acf commit 3bd8fb9

9 files changed

Lines changed: 409 additions & 132 deletions

File tree

.github/scripts/build-cf-js.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5+
ENTRY_FILE="${ROOT_DIR}/themes/InterDead/assets/js/app.js"
6+
OUTPUT_ROOT="${1:-${ROOT_DIR}/.cf-build}"
7+
OUTPUT_DIR="${OUTPUT_ROOT}/js"
8+
OUTPUT_FILE="${OUTPUT_DIR}/app.js"
9+
10+
if [[ ! -f "${ENTRY_FILE}" ]]; then
11+
echo "[InterDeadIT][CI] Entry file is missing: ${ENTRY_FILE}" >&2
12+
exit 1
13+
fi
14+
15+
mkdir -p "${OUTPUT_DIR}"
16+
17+
npx --yes esbuild "${ENTRY_FILE}" \
18+
--bundle \
19+
--format=iife \
20+
--platform=browser \
21+
--target=es2018 \
22+
--minify \
23+
--legal-comments=none \
24+
--outfile="${OUTPUT_FILE}"
25+
26+
if [[ ! -s "${OUTPUT_FILE}" ]]; then
27+
echo "[InterDeadIT][CI] Bundle output was not created: ${OUTPUT_FILE}" >&2
28+
exit 1
29+
fi
30+
31+
echo "[InterDeadIT][CI] Cloudflare-ready JS bundle created: ${OUTPUT_FILE}"

.github/workflows/interdead-auth.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- main
77
paths:
88
- "workers/interdead-auth/**"
9+
- "themes/InterDead/assets/js/**"
10+
- ".github/scripts/build-cf-js.sh"
911
- ".github/workflows/interdead-auth.yml"
1012

1113
jobs:
@@ -26,6 +28,18 @@ jobs:
2628
npm ci || npm install
2729
working-directory: .
2830

31+
- name: Build JS bundle for Cloudflare (CI-only)
32+
shell: bash
33+
run: |
34+
./.github/scripts/build-cf-js.sh "${RUNNER_TEMP}/interdead-cf"
35+
36+
- name: Upload Cloudflare JS bundle artifact
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: interdead-cf-js
40+
path: ${{ runner.temp }}/interdead-cf/js
41+
if-no-files-found: error
42+
2943
- name: Install Wrangler
3044
run: npm install -g wrangler
3145

0 commit comments

Comments
 (0)