Skip to content

Commit

Permalink
Update GH Actions workflow
Browse files Browse the repository at this point in the history
* Run workflow on PRs
* Fix default branch
  • Loading branch information
rjosephwright authored and cloudboss committed May 14, 2023
1 parent 2444e19 commit e78e7f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
name: Deploy Hugo site to Pages

on:
pull_request:
types:
- edited
- opened
- reopened
# Runs on pushes targeting the default branch
push:
branches:
- main
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -50,7 +55,8 @@ jobs:
id: pages
uses: actions/configure-pages@v3
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
run: |
[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
Expand All @@ -68,6 +74,7 @@ jobs:

# Deployment job
deploy:
if: ${{ github.event.pull_request.merged }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down

0 comments on commit e78e7f1

Please sign in to comment.