Skip to content

Commit e213d86

Browse files
committed
ci(converting to vite monorepo): converting to vite monorepo
1 parent 4d996cc commit e213d86

3 files changed

Lines changed: 70 additions & 8 deletions

File tree

.github/workflows/deploy_docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
name: Build & Deploy Docs
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup LTS Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 'lts/*'
23+
cache: 'yarn'
24+
25+
- name: Install yarn
26+
run: npm install -g yarn
27+
28+
- name: Get yarn cache directory path
29+
id: yarn-cache-dir-path
30+
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
31+
32+
- name: Cache yarn dependencies
33+
uses: actions/cache@v3
34+
id: yarn-cache
35+
with:
36+
path: |
37+
${{ steps.yarn-cache-dir-path.outputs.dir }}
38+
**\node_modules
39+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-yarn-
42+
43+
- name: Install dependencies
44+
if: steps.yarn-cache.outputs.cache-hit != 'true'
45+
run: yarn install
46+
47+
- name: Build @trrack/core
48+
run: yarn workspace @trrack/core build
49+
50+
- name: Export docs
51+
run: yarn workspace docs export
52+
53+
- name: Deploy to GitHub Pages
54+
uses: peaceiris/actions-gh-pages@v3
55+
with:
56+
github_token: ${{ secrets.GITHUB_TOKEN }}
57+
publish_dir: ./apps/docs/out
58+
publish_branch: gh-pages

apps/docs/next.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const withNextra = require('nextra')({
2323

2424
module.exports = withNextra({
2525
basePath: '/trrack',
26+
images: {
27+
unoptimized: true, // required for `next export`
28+
},
2629
});
2730

2831
// If you have other Next.js configurations, you can pass them as the parameter:

apps/docs/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"name": "docs",
3-
"version": "0.0.0",
4-
"private": true,
5-
"scripts": {
6-
"dev": "next dev",
7-
"build": "next build",
8-
"start": "next start"
9-
}
2+
"name": "docs",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"export": "next build && next export",
9+
"start": "next start"
10+
}
1011
}

0 commit comments

Comments
 (0)