CI: check before deploy

This commit is contained in:
SukkaW 2024-03-12 17:49:52 +08:00
parent b78e81f89e
commit 95cdc39de2

View File

@ -45,6 +45,18 @@ jobs:
${{ runner.os }}-v1- ${{ runner.os }}-v1-
- run: bun install - run: bun install
- run: bun run build - run: bun run build
- name: Pre-deploy check
# If the public directory doesn't exist, the build should fail.
# If the public directory is empty, the build should fail.
run: |
if [ ! -d public ]; then
echo "public directory not found"
exit 1
fi
if [ ! "$(ls -A public)" ]; then
echo "public directory is empty"
exit 1
fi
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v3 uses: peaceiris/actions-gh-pages@v3
with: with: