File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CD
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+
7+ jobs :
8+ build-test-publish :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+
13+ - name : Set up Node.js
14+ uses : actions/setup-node@v4
15+ with :
16+ node-version : 20
17+ registry-url : https://registry.npmjs.org/
18+
19+ - name : Install dependencies
20+ run : npm ci
21+
22+ - name : Build
23+ run : npm run build
24+
25+ - name : Run checks (linting, type-checking, formatting)
26+ run : npm run check
27+
28+ - name : Run tests
29+ run : npm run test
30+
31+ - name : Publish package to npm
32+ if : ${{ vars.ENVIRONMENT == 'prod' }}
33+ run : npm publish --access public
34+ env :
35+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ pull_request :
5+ branches : [ main ]
6+ push :
7+ branches : [ main ]
8+
9+ jobs :
10+ build-and-test :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v4
14+
15+ - name : Set up Node.js
16+ uses : actions/setup-node@v4
17+ with :
18+ node-version : 20
19+
20+ - name : Install dependencies
21+ run : npm ci
22+
23+ - name : Build
24+ run : npm run build
25+
26+ - name : Run checks (linting, type-checking, formatting)
27+ run : npm run check
28+
29+ - name : Run tests
30+ run : npm run test
You can’t perform that action at this time.
0 commit comments