File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deployment Preview
2+
3+ on :
4+ pull_request :
5+ types : [opened, synchronize, reopened]
6+
7+ jobs :
8+ deploy-preview :
9+ name : Build and Deploy Preview
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+ with :
16+ submodules : recursive
17+ fetch-depth : 0
18+
19+ - name : Setup Hugo
20+ uses : peaceiris/actions-hugo@v3
21+ with :
22+ hugo-version : ' latest'
23+ extended : true
24+
25+ - name : Install Node.js dependencies
26+ run : |
27+ if [ -f package.json ]; then
28+ npm ci
29+ fi
30+
31+ - name : Build Hugo site
32+ run : hugo --minify --baseURL "/"
33+
34+ - name : Deploy Preview to Netlify
35+ uses : nwtgck/actions-netlify@v3
36+ with :
37+ publish-dir : ' ./public'
38+ production-deploy : false
39+ github-token : ${{ secrets.GITHUB_TOKEN }}
40+ deploy-message : " Deploy preview for PR #${{ github.event.number }}"
41+ alias : deploy-preview-${{ github.event.number }}
42+ enable-pull-request-comment : true
43+ enable-commit-comment : false
44+ overwrites-pull-request-comment : true
45+ env :
46+ NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
47+ NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
48+ timeout-minutes : 10
You can’t perform that action at this time.
0 commit comments