Skip to content

Commit 5f0627f

Browse files
authored
Refactor Node.js CI workflow in main.yml
Refactored CI workflow to streamline steps and ensure proper installation of dependencies.
1 parent af09c16 commit 5f0627f

1 file changed

Lines changed: 22 additions & 17 deletions

File tree

.github/workflows/main.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
name: Node.js CI
22

33
on:
4-
push:
5-
branches: [ "master", "main" ] # Change this to your default branch if needed
4+
push:
5+
branches: [ "master", "main" ]
66

77
jobs:
8-
build:
9-
runs-on: ubuntu-latest
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Use Node.js LTS
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 'lts/*'
1017

11-
steps:
12-
- uses: actions/checkout@v4
18+
- name: Install pnp (Needed by Astro)
19+
run: npm i -g pnpm
1320

14-
- name: Use Node.js LTS
15-
uses: actions/setup-node@v4
16-
with:
17-
node-version: 'lts/*' # Automatically uses the latest LTS version
21+
- name: Install dependencies
22+
run: pnpm install
1823

19-
- name: Install pnp as needed by Astro
20-
run: npm i -g pnpm
24+
- name: Build project
25+
run: pnpm run build
2126

22-
- name: Install dependencies
23-
run: pnpm install
24-
25-
- name: Build project
26-
run: pnpm run build
27+
- name: Upload dist folder
28+
uses: actions/upload-artifact@v3
29+
with:
30+
name: astro-dist
31+
path: dist/

0 commit comments

Comments
 (0)