Skip to content

Commit 2904e4e

Browse files
committed
chore: Try simplified approach
1 parent a7b3dec commit 2904e4e

File tree

2 files changed

+26
-63
lines changed

2 files changed

+26
-63
lines changed

.github/workflows/deploypages.yml

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -82,53 +82,30 @@ jobs:
8282
url: ${{ steps.deployment.outputs.page_url }}
8383

8484
steps:
85-
- uses: actions/checkout@v4
85+
- name: Checkout Repository
86+
uses: actions/checkout@v4
87+
with:
88+
persist-credentials: false
89+
fetch-depth: 0
8690

87-
- name: Make build.sh executable
88-
run: chmod +x build.sh
91+
- name: Download Built Docs Artifact
92+
uses: actions/download-artifact@v4
93+
with:
94+
name: docs-raw
95+
path: ${{ github.workspace }}/build
8996

90-
- name: Install deps
91-
run: npm ci
97+
- name: Install Dependencies
98+
run: npm install
9299

93-
# ----- Build Docusaurus site (./build) -----
94-
- name: Build docs site
100+
- name: Build TinaCMS and Docusaurus Site
95101
env:
96-
ENABLE_TINA_ADMIN: true
97102
TINA_PUBLIC_CLIENT_ID: ${{ secrets.TINA_PUBLIC_CLIENT_ID }}
98-
TINA_TOKEN: ${{ secrets.TINA_TOKEN }}
99-
DOCS_BASEURL: ${{ secrets.DOCS_BASEURL }} # e.g. /Docusaurus-docs/
103+
TINA_TOKEN: ${{ secrets.TINA_TOKEN }}
104+
DOCS_BASEURL: ${{ secrets.DOCS_BASEURL }}
100105
run: npm run build
101-
102-
# ----- Build Tina admin (./admin) -----
103-
- name: Build TinaCMS admin
104-
env:
105-
TINA_PUBLIC_CLIENT_ID: ${{ secrets.TINA_PUBLIC_CLIENT_ID }}
106-
TINA_TOKEN: ${{ secrets.TINA_TOKEN }}
107-
ENABLE_TINA_ADMIN: true
108-
run: npx tinacms build
109-
110-
# ----- Copy Tina into <baseUrl>/admin -----
111-
- name: Relocate Tina admin inside baseUrl
112-
run: |
113-
set -euo pipefail
114-
BASE="${DOCS_BASEURL#/}" # strip leading /
115-
BASE="${BASE%/}" # strip trailing /
116-
SRC="./public/admin" # <<— correct location from tinacms build
117-
# If you still move it to static/cms-admin elsewhere, use that path instead
118-
if [[ ! -d "$SRC" ]]; then
119-
echo "Tina admin folder not found at $SRC"; exit 1;
120-
fi
121-
if [[ -z "$BASE" ]]; then
122-
DEST="./build/admin"
123-
else
124-
DEST="./build/${BASE}/admin"
125-
fi
126-
echo "Copying $SRC → $DEST"
127-
mkdir -p "$DEST"
128-
cp -a "$SRC"/. "$DEST"/
129-
ls -R "$DEST" | head
130-
env:
131-
DOCS_BASEURL: ${{ secrets.DOCS_BASEURL }}
106+
107+
- name: Remove gitignore file
108+
run: rm ./build/admin/.gitignore
132109

133110
# --- Upload static site as artifact ---
134111
- name: Upload Pages artifact

build.sh

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,18 @@ if [ ! -f "src/sidebars/index.json" ]; then
1717
echo '{"items": []}' > src/sidebars/index.json
1818
fi
1919

20+
# Copy Tina admin to Docusaurus static folder
21+
rm -rf static/admin
22+
cp -r public/admin static/admin
23+
2024
PROJECT_ROOT="$(pwd)"
2125
SRC_DIR="$PROJECT_ROOT/src/decks/prebuilds"
2226
OUT_DIR="$PROJECT_ROOT/static/decks"
23-
24-
echo "🎞️ Inlining Reveal.js HTML decks..."
25-
find "$SRC_DIR" -name 'index.html' | while read -r html; do
26-
rel_path="${html#$SRC_DIR/}"
27-
out_path="$OUT_DIR/$rel_path"
28-
out_dir="$(dirname "$out_path")"
29-
30-
mkdir -p "$out_dir"
31-
echo "✨ Inlining: $rel_path"
27+
@@ -18,5 +25,9 @@ find "$SRC_DIR" -name 'index.html' | while read -r html; do
3228
npx html-inline --nocompress --inlinemin --root "$PROJECT_ROOT" "$html" > "$out_path"
3329
done
3430

35-
if [[ "${ENABLE_TINA_ADMIN:-}" == "true" ]]; then
36-
BASE="${DOCS_BASEURL:-/}"
37-
BASE="${BASE#/}" ; BASE="${BASE%/}" # trim slashes
38-
39-
dest="build"
40-
[[ -n "$BASE" ]] && dest="${dest}/${BASE}"
41-
dest="${dest}/admin"
42-
43-
echo "🚚 Copying public/admin → ${dest}"
44-
mkdir -p "${dest}"
45-
cp -a public/admin/. "${dest}/"
46-
fi
31+
echo "✅ All slide decks inlined to: $OUT_DIR"
4732

48-
echo "✅ All slide decks inlined to: $OUT_DIR"
33+
echo "🛠️ Building Docusaurus site..."
34+
npm run build

0 commit comments

Comments
 (0)