Skip to content

Commit

Permalink
feat: add vuepress (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
lamngockhuong authored Jun 7, 2024
1 parent 7ec0125 commit 8a9e47c
Show file tree
Hide file tree
Showing 6 changed files with 2,143 additions and 52 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: docs

on:
# trigger deployment on every push to main branch
push:
branches: [main]
# trigger deployment manually
workflow_dispatch:

jobs:
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
# fetch all commits to get last updated time or other git log info
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
# choose pnpm version to use
version: 8
# install deps with pnpm
run_install: true

- name: Setup Node.js
uses: actions/setup-node@v4
with:
# choose node.js version to use
node-version: 20
# cache deps for pnpm
cache: pnpm

# run build script
- name: Build VuePress site
run: pnpm docs:build

# please check out the docs of the workflow for more details
# @see https://github.com/crazy-max/ghaction-github-pages
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v4
with:
# deploy to gh-pages branch
target_branch: gh-pages
# deploy the default output dir of VuePress
build_dir: docs/.vuepress/dist
env:
# @see https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ pids

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# VuePress default temp directory
docs/.vuepress/.temp
# VuePress default cache directory
docs/.vuepress/.cache
# VuePress default build output directory
docs/.vuepress/dist
12 changes: 12 additions & 0 deletions docs/.vuepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { viteBundler } from '@vuepress/bundler-vite';
import { defaultTheme } from '@vuepress/theme-default';
import { defineUserConfig } from 'vuepress';

export default defineUserConfig({
bundler: viteBundler(),
theme: defaultTheme({}),
lang: 'en-US',
title: 'NestJS boilerplate',
description: 'NestJS boilerplate',
base: '/nestjs-boilerplate/',
});
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Hello Everyone
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"typeorm": "",
"prepare": "husky"
"prepare": "husky",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
},
"dependencies": {
"@nestjs/common": "10.3.9",
Expand All @@ -41,6 +43,9 @@
"@types/jest": "29.5.12",
"@types/node": "20.14.2",
"@types/supertest": "6.0.2",
"@vuepress/bundler-vite": "2.0.0-rc.13",
"@vuepress/plugin-theme-data": "2.0.0-rc.0",
"@vuepress/theme-default": "2.0.0-rc.35",
"env-cmd": "10.1.0",
"eslint": "9.4.0",
"eslint-config-prettier": "9.1.0",
Expand All @@ -56,7 +61,9 @@
"ts-node": "10.9.2",
"tsconfig-paths": "4.2.0",
"typescript": "5.4.5",
"typescript-eslint": "7.12.0"
"typescript-eslint": "7.12.0",
"vue": "3.4.27",
"vuepress": "2.0.0-rc.13"
},
"jest": {
"moduleFileExtensions": [
Expand Down
Loading

0 comments on commit 8a9e47c

Please sign in to comment.