Skip to content

Commit 1830465

Browse files
committed
ci: use another way to deploy pages
1 parent b9f3356 commit 1830465

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

.github/workflows/pages.yaml

+23-21
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1-
# Sample workflow for building and deploying a Hugo site to GitHub Pages
2-
name: Deploy website to Pages
1+
name: Pages
32

43
on:
5-
# Runs on pushes targeting the default branch
64
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
167

178
jobs:
18-
# Build job
19-
build:
9+
pages:
2010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
2113
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
2430
- 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
3032
with:
3133
github_token: ${{ secrets.GITHUB_TOKEN }}
3234
publish_dir: ./website

0 commit comments

Comments
 (0)