Skip to content

Commit 7cb3961

Browse files
Updating job
Signed-off-by: Steve Springett <steve@springett.us>
1 parent a342ec1 commit 7cb3961

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

.github/workflows/node.js.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3-
4-
name: Node.js CI
1+
name: Build and Deploy to GitHub Pages
52

63
on:
74
push:
8-
branches: [ "main" ]
9-
pull_request:
10-
branches: [ "main" ]
5+
branches:
6+
- main
117

128
jobs:
139
build:
14-
1510
runs-on: ubuntu-latest
1611

1712
strategy:
1813
matrix:
19-
node-version: [18.x, 20.x, 22.x]
14+
node-version: [18.x]
2015

2116
steps:
22-
- uses: actions/checkout@v4
23-
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v4
25-
with:
26-
node-version: ${{ matrix.node-version }}
27-
cache: 'npm'
28-
- run: npm ci
29-
- run: npm run build --if-present
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- name: Install dependencies
26+
run: npm install
27+
28+
- name: Build project
29+
run: npm run build
30+
31+
- name: Deploy to GitHub Pages
32+
uses: peaceiris/actions-gh-pages@v3
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: ./dist # Change this to your build directory if different
36+
cname: yourcustomdomain.com # Optional: Remove if not using a custom domain

0 commit comments

Comments
 (0)