diff --git a/.github/workflows/deploy-pr-preview.yml b/.github/workflows/deploy-pr-preview.yml new file mode 100644 index 0000000..a248a6d --- /dev/null +++ b/.github/workflows/deploy-pr-preview.yml @@ -0,0 +1,25 @@ +# .github/workflows/preview.yml +name: Deploy PR preview +concurrency: preview-${{ github.ref }} +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed +jobs: + deploy-preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: npm i && npm run buildDocs + env: + CI: false + if: github.event.action != 'closed' + - uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./docs/public + preview-branch: gh-pages + umbrella-dir: pr-preview + action: auto diff --git a/.gitignore b/.gitignore index 7274b6c..f956f12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ # Deliberately commit dist folder so we can directly consume the repo as a dependency. # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. +# build files +/docs/static +/docs/public/static + # dependencies /node_modules /.pnp diff --git a/docs/asset-manifest.json b/docs/asset-manifest.json index 185d4c0..f6959f8 100644 --- a/docs/asset-manifest.json +++ b/docs/asset-manifest.json @@ -1,15 +1,15 @@ { "files": { - "main.css": "./static/css/main.053ff0b9.css", - "main.js": "./static/js/main.9d0ebd6a.js", - "static/js/787.43483533.chunk.js": "./static/js/787.43483533.chunk.js", + "main.css": "./static/css/main.2451c968.css", + "main.js": "./static/js/main.73c91fc1.js", + "static/js/453.ebf7af86.chunk.js": "./static/js/453.ebf7af86.chunk.js", "index.html": "./index.html", - "main.053ff0b9.css.map": "./static/css/main.053ff0b9.css.map", - "main.9d0ebd6a.js.map": "./static/js/main.9d0ebd6a.js.map", - "787.43483533.chunk.js.map": "./static/js/787.43483533.chunk.js.map" + "main.2451c968.css.map": "./static/css/main.2451c968.css.map", + "main.73c91fc1.js.map": "./static/js/main.73c91fc1.js.map", + "453.ebf7af86.chunk.js.map": "./static/js/453.ebf7af86.chunk.js.map" }, "entrypoints": [ - "static/css/main.053ff0b9.css", - "static/js/main.9d0ebd6a.js" + "static/css/main.2451c968.css", + "static/js/main.73c91fc1.js" ] } \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 20c1985..f1de72a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -Vectara UI library
\ No newline at end of file +Vectara UI library
\ No newline at end of file diff --git a/docs/public/asset-manifest.json b/docs/public/asset-manifest.json new file mode 100644 index 0000000..a7625cc --- /dev/null +++ b/docs/public/asset-manifest.json @@ -0,0 +1,15 @@ +{ + "files": { + "main.css": "./static/css/main.2451c968.css", + "main.js": "./static/js/main.f22e287a.js", + "static/js/453.ebf7af86.chunk.js": "./static/js/453.ebf7af86.chunk.js", + "index.html": "./index.html", + "main.2451c968.css.map": "./static/css/main.2451c968.css.map", + "main.f22e287a.js.map": "./static/js/main.f22e287a.js.map", + "453.ebf7af86.chunk.js.map": "./static/js/453.ebf7af86.chunk.js.map" + }, + "entrypoints": [ + "static/css/main.2451c968.css", + "static/js/main.f22e287a.js" + ] +} \ No newline at end of file diff --git a/docs/public/index.html b/docs/public/index.html new file mode 100644 index 0000000..07c6ec9 --- /dev/null +++ b/docs/public/index.html @@ -0,0 +1 @@ +Vectara UI library
\ No newline at end of file diff --git a/docs/public/robots.txt b/docs/public/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/docs/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/docs/public/vectara-favicon.png b/docs/public/vectara-favicon.png new file mode 100644 index 0000000..504028d Binary files /dev/null and b/docs/public/vectara-favicon.png differ diff --git a/package.json b/package.json index 1e3cacc..3c710cc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@vectara/vectara-ui", "version": "0.0.2", - "homepage": "./", + "homepage": "https://vectara.github.io/vectara-ui/", "description": "Vectara's design system, codified as a React and Sass component library", "author": "Vectara", "repository": { @@ -25,7 +25,7 @@ "types": "lib/index.d.ts", "scripts": { "start": "PORT=2000 react-scripts start", - "buildDocs": "BUILD_PATH='./docs' react-scripts build", + "buildDocs": "BUILD_PATH='./docs/public' PUBLIC_URL='.' react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "buildLib": "npx tsc --project tsconfig.lib.json && npm run copyStyleUtils && npm run copyComponentStyles && npm run compileCss", diff --git a/src/docs/Docs.tsx b/src/docs/Docs.tsx index 051665e..cf49daa 100644 --- a/src/docs/Docs.tsx +++ b/src/docs/Docs.tsx @@ -1,4 +1,4 @@ -import { Link, Navigate, Route, BrowserRouter as Router, Routes, useLocation } from "react-router-dom"; +import { Link, Navigate, Route, HashRouter as Router, Routes, useLocation } from "react-router-dom"; import { BiLogoGithub } from "react-icons/bi"; import { VuiAppHeader, @@ -20,8 +20,7 @@ import "./index.scss"; export const Docs = () => { return ( - // Fix routing when deployed to GitHub pages (https://vectara.github.io/vectara-ui/). - + );