Skip to content

Commit 0d9c221

Browse files
authored
ci: fix pagefind command (#6)
1 parent de85739 commit 0d9c221

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/hugo.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
# Runs on pushes targeting the default branch
66
push:
77
branches: ["main"]
8+
pull_request:
9+
branches: ["main"]
810

911
# Allows you to run this workflow manually from the Actions tab
1012
workflow_dispatch:
@@ -53,10 +55,10 @@ jobs:
5355
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
5456
HUGO_ENVIRONMENT: production
5557
run: |
56-
npm_config_yes=true npx pagefind --site 'public' --output-path 'static/pagefind'
5758
hugo \
5859
--minify \
5960
--baseURL "${{ steps.pages.outputs.base_url }}/"
61+
npm_config_yes=true npx pagefind --site 'public' --output-path 'public/pagefind'
6062
- name: Upload artifact
6163
uses: actions/upload-pages-artifact@v3
6264
with:
@@ -69,6 +71,7 @@ jobs:
6971
url: ${{ steps.deployment.outputs.page_url }}
7072
runs-on: ubuntu-latest
7173
needs: build
74+
if: github.ref == 'refs/heads/main'
7275
steps:
7376
- name: Deploy to GitHub Pages
7477
id: deployment

0 commit comments

Comments
 (0)