Skip to content

Commit de2bb92

Browse files
committed
docs: Deploy site
1 parent 6128366 commit de2bb92

File tree

2 files changed

+17
-37
lines changed

2 files changed

+17
-37
lines changed

.github/workflows/nextjs.yml

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: Deploy Next.js site to Pages
77
on:
88
# Runs on pushes targeting the default branch
99
push:
10-
branches: ["main"]
10+
branches: ['main']
1111

1212
# Allows you to run this workflow manually from the Actions tab
1313
workflow_dispatch:
@@ -19,7 +19,7 @@ permissions:
1919
id-token: write
2020

2121
concurrency:
22-
group: "pages"
22+
group: 'pages'
2323
cancel-in-progress: true
2424

2525
defaults:
@@ -33,35 +33,13 @@ jobs:
3333
steps:
3434
- name: Checkout
3535
uses: actions/checkout@v4
36-
- name: Detect package manager
37-
id: detect-package-manager
38-
run: |
39-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
40-
echo "manager=yarn" >> $GITHUB_OUTPUT
41-
echo "command=install" >> $GITHUB_OUTPUT
42-
echo "runner=yarn" >> $GITHUB_OUTPUT
43-
exit 0
44-
elif [ -f "${{ github.workspace }}/package.json" ]; then
45-
echo "manager=npm" >> $GITHUB_OUTPUT
46-
echo "command=ci" >> $GITHUB_OUTPUT
47-
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
48-
exit 0
49-
else
50-
echo "Unable to determine package manager"
51-
exit 1
52-
fi
5336
- name: Setup Node
5437
uses: actions/setup-node@v4
5538
with:
56-
node-version: "20"
57-
cache: ${{ steps.detect-package-manager.outputs.manager }}
39+
node-version: 22
5840
- name: Setup Pages
5941
uses: actions/configure-pages@v5
6042
with:
61-
# Automatically inject basePath in your Next.js configuration file and disable
62-
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
63-
#
64-
# You may remove this line if you want to manage the configuration yourself.
6543
static_site_generator: next
6644
- name: Restore cache
6745
uses: actions/cache@v4
@@ -74,15 +52,17 @@ jobs:
7452
restore-keys: |
7553
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
7654
- name: Install dependencies
77-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
55+
run: npm install
7856
- name: Build with Next.js
79-
run: ${{ steps.detect-package-manager.outputs.runner }} next build
57+
run: |
58+
cd ../.. && npm install && npm run dist
59+
cd packages/docs
60+
npm run build
8061
- name: Upload artifact
8162
uses: actions/upload-pages-artifact@v3
8263
with:
83-
path: ./out
64+
path: packages/docs/out
8465

85-
# Deployment job
8666
deploy:
8767
environment:
8868
name: github-pages

packages/docs/pages/indicators/trend.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ console.log(sma.getResult()); // 47`,
2424

2525
for (const value of values) {
2626
sma.add(value);
27-
const result = sma.isStable ? sma.getResult().toFixed(2) : null;
27+
const result = sma.isStable ? sma.getResult()!.toFixed(2) : null;
2828
allResults.push({value, result});
2929
}
3030

3131
return {
32-
result: sma.isStable ? sma.getResult().toFixed(2) : null,
32+
result: sma.isStable ? sma.getResult()!.toFixed(2) : null,
3333
allResults,
3434
};
3535
},
@@ -55,12 +55,12 @@ console.log(ema.getResult());`,
5555

5656
for (const value of values) {
5757
ema.add(value);
58-
const result = ema.isStable ? ema.getResult().toFixed(2) : null;
58+
const result = ema.isStable ? ema.getResult()!.toFixed(2) : null;
5959
allResults.push({value, result});
6060
}
6161

6262
return {
63-
result: ema.isStable ? ema.getResult().toFixed(2) : null,
63+
result: ema.isStable ? ema.getResult()!.toFixed(2) : null,
6464
allResults,
6565
};
6666
},
@@ -84,12 +84,12 @@ console.log(dema.getResult());`,
8484

8585
for (const value of values) {
8686
dema.add(value);
87-
const result = dema.isStable ? dema.getResult().toFixed(2) : null;
87+
const result = dema.isStable ? dema.getResult()!.toFixed(2) : null;
8888
allResults.push({value, result});
8989
}
9090

9191
return {
92-
result: dema.isStable ? dema.getResult().toFixed(2) : null,
92+
result: dema.isStable ? dema.getResult()!.toFixed(2) : null,
9393
allResults,
9494
};
9595
},
@@ -115,12 +115,12 @@ console.log(wma.getResult());`,
115115

116116
for (const value of values) {
117117
wma.add(value);
118-
const result = wma.isStable ? wma.getResult().toFixed(2) : null;
118+
const result = wma.isStable ? wma.getResult()!.toFixed(2) : null;
119119
allResults.push({value, result});
120120
}
121121

122122
return {
123-
result: wma.isStable ? wma.getResult().toFixed(2) : null,
123+
result: wma.isStable ? wma.getResult()!.toFixed(2) : null,
124124
allResults,
125125
};
126126
},

0 commit comments

Comments
 (0)