diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 3fa17c2..1566be2 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -5,6 +5,8 @@ on: # Runs on pushes targeting the default branch push: branches: ["main"] + pull_request: + branches: ["main"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -53,10 +55,10 @@ jobs: HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache HUGO_ENVIRONMENT: production run: | - npm_config_yes=true npx pagefind --site 'public' --output-path 'static/pagefind' hugo \ --minify \ --baseURL "${{ steps.pages.outputs.base_url }}/" + npm_config_yes=true npx pagefind --site 'public' --output-path 'public/pagefind' - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: @@ -69,6 +71,7 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build + if: github.ref == 'refs/heads/main' steps: - name: Deploy to GitHub Pages id: deployment