Skip to content

Commit a0edd8d

Browse files
committed
ci: added build only action for push and pull requests
1 parent 09b344a commit a0edd8d

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/build.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
node-version: [ 20.x ]
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
24+
- name: Get yarn cache directory path
25+
id: yarn-cache-dir-path
26+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
27+
28+
- name: Cache npm packages
29+
uses: actions/cache@v4
30+
id: yarn-cache
31+
with:
32+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
33+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-yarn-
36+
37+
- name: Install dependencies
38+
if: steps.yarn-cache.outputs.cache-hit != 'true'
39+
run: yarn install
40+
41+
- name: Build app
42+
run: yarn build

0 commit comments

Comments
 (0)