File tree 1 file changed +23
-21
lines changed
1 file changed +23
-21
lines changed Original file line number Diff line number Diff line change 1
- # Sample workflow for building and deploying a Hugo site to GitHub Pages
2
- name : Deploy website to Pages
1
+ name : Pages
3
2
4
3
on :
5
- # Runs on pushes targeting the default branch
6
4
push :
7
- pull_request :
8
-
9
- # Allows you to run this workflow manually from the Actions tab
10
- workflow_dispatch :
11
-
12
- # Default to bash
13
- defaults :
14
- run :
15
- shell : bash
5
+ branches :
6
+ - master # default branch
16
7
17
8
jobs :
18
- # Build job
19
- build :
9
+ pages :
20
10
runs-on : ubuntu-latest
11
+ permissions :
12
+ contents : write
21
13
steps :
22
- - name : Install and Build
23
- run : npm install && npm run build
14
+ - uses : actions/checkout@v2
15
+ - name : Use Node.js 18
16
+ uses : actions/setup-node@v2
17
+ with :
18
+ node-version : " 18"
19
+ - name : Cache NPM dependencies
20
+ uses : actions/cache@v2
21
+ with :
22
+ path : node_modules
23
+ key : ${{ runner.OS }}-npm-cache
24
+ restore-keys : |
25
+ ${{ runner.OS }}-npm-cache
26
+ - name : Install Dependencies
27
+ run : npm install
28
+ - name : Build
29
+ run : npm run build
24
30
- name : Deploy
25
- uses : peaceiris/actions-gh-pages@v4
26
- # If you're changing the branch from main,
27
- # also change the `main` in `refs/heads/main`
28
- # below accordingly.
29
- if : github.ref == 'refs/heads/master'
31
+ uses : peaceiris/actions-gh-pages@v3
30
32
with :
31
33
github_token : ${{ secrets.GITHUB_TOKEN }}
32
34
publish_dir : ./website
You can’t perform that action at this time.
0 commit comments