Skip to content

Commit e635b40

Browse files
committed
2 parents 054ce1c + 8a2de18 commit e635b40

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

.github/workflows/webpack.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: NodeJS with Webpack
1+
name: NodeJS with Webpack & Deploy to GitHub Pages
22

33
on:
44
push:
@@ -7,22 +7,30 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10-
build:
10+
build-and-deploy:
1111
runs-on: ubuntu-latest
12-
1312
strategy:
1413
matrix:
1514
node-version: [18.x, 20.x, 22.x]
1615

1716
steps:
18-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v4
18+
with:
19+
persist-credentials: true # so gh-pages can push
20+
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
26+
- name: Install dependencies
27+
run: npm ci
1928

20-
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: ${{ matrix.node-version }}
29+
- name: Build
30+
run: npm run build
2431

25-
- name: Build
26-
run: |
27-
npm install
28-
npm run dev
32+
- name: Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: ./build

0 commit comments

Comments
 (0)