Skip to content

Commit 5b5f716

Browse files
Dale KunceDale Kunce
authored andcommitted
Fix GitHub Actions deployment workflow
- Remove duplicate checkout steps in deploy job - Fix artifact download version mismatch (use @v4 consistently) - Add verification step to check for empty _site directory - Improve error handling for missing build artifacts This should resolve most recent build error
1 parent 6e8fa3a commit 5b5f716

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,29 @@ jobs:
6262
token: ${{ secrets.GITHUB_TOKEN }}
6363
fetch-depth: 0
6464

65-
- name: Checkout master branch
66-
uses: actions/checkout@v4
67-
with:
68-
ref: master
69-
token: ${{ secrets.GITHUB_TOKEN }}
70-
fetch-depth: 0
71-
7265
- name: Download build artifacts
73-
uses: actions/download-artifact@v5
66+
uses: actions/download-artifact@v4
7467
with:
7568
name: site-build
7669
path: _site/
7770

71+
- name: Verify build artifacts
72+
run: |
73+
echo "Checking _site directory contents:"
74+
ls -la _site/ || echo "No _site directory found"
75+
if [ ! -d "_site" ] || [ -z "$(ls -A _site)" ]; then
76+
echo "Error: _site directory is empty or missing"
77+
exit 1
78+
fi
79+
7880
- name: Deploy to master branch
7981
run: |
8082
# Configure git
8183
git config --local user.email "[email protected]"
8284
git config --local user.name "GitHub Action"
8385
84-
# Remove all files except .git
85-
find . -maxdepth 1 ! -name '.git' ! -name '.' ! -name '..' -exec rm -rf {} +
86+
# Remove all files except .git and _site
87+
find . -maxdepth 1 ! -name '.git' ! -name '.' ! -name '..' ! -name '_site' -exec rm -rf {} +
8688
8789
# Copy built site files to root
8890
cp -r _site/* .

0 commit comments

Comments
 (0)