Skip to content

Commit

Permalink
chore: docs deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianWielga committed Aug 13, 2024
1 parent c1b590c commit aeb1e1f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
docs:
runs-on: ubuntu-latest
needs: [ "build", "release" ]
if: ${{ github.ref == 'refs/heads/master' }}
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -135,6 +135,18 @@ jobs:
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run deploy-storybook -- --ci --host-token-env-variable=GITHUB_TOKEN
env:
GITHUB_TOKEN: JulianWielga:${{ secrets.GITHUB_TOKEN }}
- run: |
VERSION=$(npm pkg get version | tr -d '"')
echo "version=$VERSION" >> $GITHUB_ENV
- run: npm run build-storybook -- -o docs
- uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
destination_dir: v${{ env.version }}
- uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
destination_dir: latest
13 changes: 13 additions & 0 deletions src/demo.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import React from "react";
import { name, version } from "../package.json";
import { ContentGetter } from "./demo/contentGetter";
import { DebugButtons } from "./demo/DebugButtons";
import { DemoWindowKind } from "./demo/DemoWindowKind";
import { WindowManagerProvider } from "./index";

const Header: React.FC = () => {
if (window["Cypress"]) return null;

return (
<header style={{ fontFamily: "monospace" }}>
<h1>{name}</h1>
<h2>v{version}</h2>
</header>
);
};

const Demo: React.FC = () => {
return (
<WindowManagerProvider<DemoWindowKind>
Expand All @@ -14,6 +26,7 @@ const Demo: React.FC = () => {
},
}}
>
<Header />
<DebugButtons />
</WindowManagerProvider>
);
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"jsx": "react",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
"esModuleInterop": true,
"resolveJsonModule": true
},
"include": [
"src/**/*",
Expand Down

0 comments on commit aeb1e1f

Please sign in to comment.