You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 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
5
2
6
3
on:
7
4
push:
8
-
branches: [ "main" ]
9
-
pull_request:
10
-
branches: [ "main" ]
5
+
branches:
6
+
- main
11
7
12
8
jobs:
13
9
build:
14
-
15
10
runs-on: ubuntu-latest
16
11
17
12
strategy:
18
13
matrix:
19
-
node-version: [18.x, 20.x, 22.x]
14
+
node-version: [18.x]
20
15
21
16
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