Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e78e7f1

Browse files
rjosephwrightcloudboss
authored andcommitted
Update GH Actions workflow
* Run workflow on PRs * Fix default branch
1 parent 2444e19 commit e78e7f1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/hugo.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
name: Deploy Hugo site to Pages
33

44
on:
5+
pull_request:
6+
types:
7+
- edited
8+
- opened
9+
- reopened
510
# Runs on pushes targeting the default branch
611
push:
712
branches:
8-
- main
13+
- master
914

1015
# Allows you to run this workflow manually from the Actions tab
1116
workflow_dispatch:
@@ -50,7 +55,8 @@ jobs:
5055
id: pages
5156
uses: actions/configure-pages@v3
5257
- name: Install Node.js dependencies
53-
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
58+
run: |
59+
[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true
5460
- name: Build with Hugo
5561
env:
5662
# For maximum backward compatibility with Hugo modules
@@ -68,6 +74,7 @@ jobs:
6874

6975
# Deployment job
7076
deploy:
77+
if: ${{ github.event.pull_request.merged }}
7178
environment:
7279
name: github-pages
7380
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)