Skip to content

Commit d2848c6

Browse files
authored
Refactor extraction and deployment directory names
Updated the extraction process to ensure the static files are in a 'public' directory and adjusted the source directory for the deployment actions. Signed-off-by: Lee Calcote <leecalcote@gmail.com>
1 parent b48b8f3 commit d2848c6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/build-and-preview-site.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,24 @@ jobs:
5555

5656
- name: Extract site
5757
if: github.event_name == 'pull_request'
58-
run: unzip -q public-dir.zip
58+
run: |
59+
unzip -q public-dir.zip
60+
# Ensure the extracted folder has the static files in a 'public' dir for the action
61+
if [ -d "public-dir" ] && [ ! -d "public" ]; then
62+
mv public-dir public
63+
elif [ ! -d "public" ]; then
64+
echo "Warning: Neither public nor public-dir found after extraction"
65+
fi
5966
6067
- name: Deploy Preview
6168
if: github.event_name == 'pull_request' && github.event.action != 'closed'
6269
uses: rossjrw/pr-preview-action@v1
6370
with:
64-
source-dir: public-dir # ← this matches the folder created by your script.sh
71+
source-dir: public
6572

6673
- name: Remove Preview on Close
6774
if: github.event_name == 'pull_request' && github.event.action == 'closed'
6875
uses: rossjrw/pr-preview-action@v1
6976
with:
70-
source-dir: public-dir
77+
source-dir: public
7178
remove: true

0 commit comments

Comments
 (0)