Skip to content

Commit

Permalink
chore: add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mrderyk committed May 1, 2024
1 parent cc7e363 commit 21e1913
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 14 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/deploy-pr-preview.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 8 additions & 8 deletions docs/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./vectara-favicon.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Vectara UI library"/><title>Vectara UI library</title><script defer="defer" src="./static/js/main.9d0ebd6a.js"></script><link href="./static/css/main.053ff0b9.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./vectara-favicon.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Vectara UI library"/><title>Vectara UI library</title><script defer="defer" src="./static/js/main.73c91fc1.js"></script><link href="./static/css/main.2451c968.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
15 changes: 15 additions & 0 deletions docs/public/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
1 change: 1 addition & 0 deletions docs/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./vectara-favicon.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Vectara UI library"/><title>Vectara UI library</title><script defer="defer" src="./static/js/main.f22e287a.js"></script><link href="./static/css/main.2451c968.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
3 changes: 3 additions & 0 deletions docs/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
Binary file added docs/public/vectara-favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions src/docs/Docs.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -20,8 +20,7 @@ import "./index.scss";

export const Docs = () => {
return (
// Fix routing when deployed to GitHub pages (https://vectara.github.io/vectara-ui/).
<Router basename={process.env.NODE_ENV === "production" ? "/vectara-ui/" : undefined}>
<Router>
<DocsContent />
</Router>
);
Expand Down

0 comments on commit 21e1913

Please sign in to comment.