@@ -2,23 +2,80 @@ name: Build
22
33on :
44 workflow_dispatch :
5- workflow_call : # Makes this workflow reusable
5+ pull_request :
6+ types :
7+ - opened
8+ - reopened
9+ - synchronize
10+ - ready_for_review
11+
12+ concurrency :
13+ group : ${{ github.workflow }}-${{ github.ref }}
14+ cancel-in-progress : true
615
716jobs :
8- build :
17+ install :
18+ name : Install Dependencies
919 runs-on : ubuntu-latest
20+ steps :
21+ - uses : actions/checkout@v4
22+
23+ - name : Setup Node.js
24+ uses : actions/setup-node@v4
25+ with :
26+ node-version : " 22"
27+ cache : " npm"
1028
29+ - name : Cache node_modules
30+ uses : actions/cache@v4
31+ id : node-modules-cache
32+ with :
33+ path : |
34+ node_modules
35+ ~/.npm
36+ key : ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
37+ restore-keys : |
38+ ${{ runner.os }}-node-modules-
39+
40+ - name : Install dependencies
41+ if : steps.node-modules-cache.outputs.cache-hit != 'true'
42+ run : npm ci
43+
44+ build :
45+ name : Build
46+ needs : install
47+ runs-on : ubuntu-latest
1148 steps :
12- - uses : actions/checkout@v4
49+ - uses : actions/checkout@v4
1350
14- - name : Setup Node.js
15- uses : actions/setup-node@v4
16- with :
17- node-version : ' 22 '
18- cache : ' npm'
51+ - name : Setup Node.js
52+ uses : actions/setup-node@v4
53+ with :
54+ node-version : " 22 "
55+ cache : " npm"
1956
20- - name : Install dependencies
21- run : npm ci
57+ - name : Restore node_modules from cache
58+ id : node-modules-cache
59+ uses : actions/cache@v4
60+ with :
61+ path : |
62+ node_modules
63+ key : ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
64+ restore-keys : |
65+ ${{ runner.os }}-node-modules-
2266
23- - name : Build
24- run : npm run build
67+ - name : Install dependencies (fallback)
68+ if : steps.node-modules-cache.outputs.cache-hit != 'true'
69+ run : npm ci --no-audit --prefer-offline
70+ - name : Build
71+ run : npm run build
72+ env :
73+ NEXT_PUBLIC_BUILDER_ID : " "
74+ NEXT_PUBLIC_GTM_ID : " GTM-XXXXXXXX"
75+ NEXT_PUBLIC_WEBSITE_URL : " https://request.network"
76+ NEXT_PUBLIC_DOCUMENTATION_URL : " https://docs.request.network/building-blocks/templates/request-checkout"
77+ NEXT_PUBLIC_NPM_PACKAGE_URL : " https://www.npmjs.com/package/@requestnetwork/payment-widget"
78+ NEXT_PUBLIC_DEMO_URL : " https://calendly.com/mariana-rn/request-network-intro"
79+ NEXT_PUBLIC_INTEGRATION_URL : " https://docs.request.network/building-blocks/templates/request-checkout"
80+ NEXT_PUBLIC_RN_API_CLIENT_ID : " rn_f6mr53l2yfcdv4sych5adq7gez3avurq"
81+ NEXT_PUBLIC_REQUEST_API_URL : " https://api.stage.request.network"
0 commit comments