Skip to content

Commit bd7162f

Browse files
committed
chore: correct the action
1 parent 2ada8dd commit bd7162f

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

.github/workflows/deploypages.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,26 @@ jobs:
9595
# ----- Copy Tina into <baseUrl>/admin -----
9696
- name: Relocate Tina admin inside baseUrl
9797
run: |
98-
set -euo pipefail
99-
BASE="${DOCS_BASEURL#/}" # strip leading /
100-
BASE="${BASE%/}" # strip trailing /
101-
if [[ -z "$BASE" ]]; then
102-
echo "Base URL is '/', nothing to move."
103-
exit 0
104-
fi
105-
SRC="./admin"
106-
DEST="./build/${BASE}/admin"
107-
echo "Copying $SRC → $DEST"
108-
mkdir -p "$DEST"
109-
cp -a "$SRC"/. "$DEST"/
110-
ls -R "$DEST" | head
98+
set -euo pipefail
99+
BASE="${DOCS_BASEURL#/}" # strip leading /
100+
BASE="${BASE%/}" # strip trailing /
101+
SRC="./public/admin" # <<— correct location from tinacms build
102+
# If you still move it to static/cms-admin elsewhere, use that path instead
103+
if [[ ! -d "$SRC" ]]; then
104+
echo "Tina admin folder not found at $SRC"; exit 1;
105+
fi
106+
if [[ -z "$BASE" ]]; then
107+
DEST="./build/admin"
108+
else
109+
DEST="./build/${BASE}/admin"
110+
fi
111+
echo "Copying $SRC → $DEST"
112+
mkdir -p "$DEST"
113+
cp -a "$SRC"/. "$DEST"/
114+
ls -R "$DEST" | head
111115
env:
112-
DOCS_BASEURL: ${{ secrets.DOCS_BASEURL }}
116+
DOCS_BASEURL: ${{ secrets.DOCS_BASEURL }}
117+
113118

114119
# ----- Publish to gh-pages -----
115120
- name: Deploy to GitHub Pages

0 commit comments

Comments
 (0)