ci: add pre-build cleanup step for artifact updates

Add a cleanup step to remove the bundled directory before building when
running the latest Hugo version on push or merged PR events. This ensures
old or unused JavaScript files are not included in the updated artifacts.

Signed-off-by: Sped0n <hi@sped0n.com>
This commit is contained in:
Sped0n
2026-02-04 04:22:40 +08:00
parent 136c2303f9
commit 546791e90b

View File

@@ -64,10 +64,16 @@ jobs:
- name: Install project dependencies
run: 'pnpm install'
- name: Pre-build cleanup
if: >
matrix.hugo-version == 'latest' &&
(github.event_name == 'push' || github.event.pull_request.merged == true)
run: 'rm -rf bundled'
- name: Build
run: 'pnpm run build'
- name: Commit
- name: Push artifacts
if: >
matrix.hugo-version == 'latest' &&
(github.event_name == 'push' || github.event.pull_request.merged == true)