Skip to content

Commit

Permalink
deploy docs to gh pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sitek94 committed Nov 26, 2023
1 parent b57e6cf commit b59cb86
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 6 deletions.
43 changes: 40 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
name: 🔍 Detect changes
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
nestjs: ${{ steps.filter.outputs.nestjs }}
remix: ${{ steps.filter.outputs.remix }}
steps:
Expand All @@ -24,12 +25,16 @@ jobs:
id: filter
with:
filters: |
docs:
- 'docs/**'
- 'libs/ui/**'
nestjs:
- 'apps/nestjs/**'
- 'libs/types/**'
remix:
- 'apps/remix/**'
- 'apps/types/**'
- 'libs/types/**'
- 'libs/ui/**'
lint:
name: ⬣ ESLint
Expand Down Expand Up @@ -157,7 +162,7 @@ jobs:
run: pnpm build

deploy-nestjs:
name: 🚀 Deploy NestJS App
name: 🐯 Deploy NestJS App
needs: [changes, lint, typecheck, test, e2e, build]
if: needs.changes.outputs.nestjs == 'true' && github.ref == 'refs/heads/main'

Expand All @@ -176,7 +181,7 @@ jobs:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

deploy-remix:
name: 🚀 Deploy Remix App
name: 💿 Deploy Remix App
needs: [changes, lint, typecheck, test, e2e, build]
if: needs.changes.outputs.remix == 'true' && github.ref == 'refs/heads/main'

Expand All @@ -193,3 +198,35 @@ jobs:
run: flyctl deploy --config ./apps/remix/fly.toml --dockerfile ./apps/remix/Dockerfile --remote-only --build-arg COMMIT_SHA=${{ github.sha }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

deploy-docs:
name: 📜 Deploy Docs
needs: [changes, lint, typecheck, test, e2e, build]
if: needs.changes.outputs.docs == 'true' && github.ref == 'refs/heads/main'

runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: 📥 Install Dependencies
run: pnpm install

- name: 🏗️ Build
run: pnpm build:docs

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./apps/docs/build
2 changes: 1 addition & 1 deletion apps/docs/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { StorybookConfig } from '@storybook/react-vite'

const config: StorybookConfig = {
stories: ['../**/*.stories.@(js|jsx|mjs|ts|tsx)'],
stories: ['../stories/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const preview: Preview = {
docs: {
theme: themes.dark,
},
backgrounds: {
default: 'dark',
},
},
decorators: [
withThemeByClassName({
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "module",
"scripts": {
"develop": "storybook dev -p 6006",
"build": "storybook build --docs",
"start": "serve storybook-static",
"build": "storybook build -o build",
"start": "serve build",
"clean": "rm -rf .turbo && rm -rf node_modules",
"lint": "eslint ./stories/*.stories.tsx --max-warnings 0"
},
Expand Down
1 change: 1 addition & 0 deletions apps/docs/stories/button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const meta: Meta<typeof Button> = {
options: ['button', 'submit', 'reset'],
},
},

}

export default meta
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"format": "prettier --write .",
"lint:fix": "pnpm lint -fix",
"lint": "eslint --ext .ts,.tsx ./apps ./libs",
"start:docs": "pnpm -F docs start",
"start:nestjs": "pnpm -F nestjs start",
"start:remix": "pnpm -F remix start",
"start": "pnpm -r start",
Expand Down

0 comments on commit b59cb86

Please sign in to comment.