Skip to content

Commit ff1db42

Browse files
authored
Refactor build workflow for Node.js 20
1 parent fed2fae commit ff1db42

1 file changed

Lines changed: 30 additions & 19 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,39 @@ name: gh-build
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
7+
68
pull_request:
7-
branches: [ main ]
9+
branches:
10+
- main
11+
12+
permissions:
13+
contents: write
814

915
jobs:
1016
build:
1117
runs-on: ubuntu-latest
18+
1219
steps:
13-
- uses: actions/checkout@v3
14-
15-
- name: Use Node.js 14.x
16-
uses: actions/setup-node@v3
17-
with:
18-
node-version: 14.x
19-
20-
- name: Build
21-
run: |
22-
yarn install
23-
yarn build
24-
25-
- name: Deploy 🚀
26-
uses: JamesIves/github-pages-deploy-action@v4.2.3
27-
with:
28-
branch: gh-pages # The branch the action should deploy to.
29-
folder: build # The folder the action should deploy.
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v6
25+
with:
26+
node-version: "20"
27+
cache: "yarn"
28+
29+
- name: Install dependencies
30+
run: yarn install --frozen-lockfile
31+
32+
- name: Build
33+
run: yarn build
34+
35+
- name: Deploy to GitHub Pages
36+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
37+
uses: JamesIves/github-pages-deploy-action@v4
38+
with:
39+
branch: gh-pages
40+
folder: build

0 commit comments

Comments
 (0)