Skip to content

Commit

Permalink
feat: update deployment & remove old docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vinothpandian committed Feb 20, 2024
1 parent 1f9784c commit 1e8f6a1
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 942 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["docs", "documentation", "tests"]
"ignore": ["docs", "tests"]
}
65 changes: 21 additions & 44 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,35 @@ on:

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
name: Deploy ReactSketchCanvas documentation
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v3
- name: Install, build, and upload your site
uses: withastro/action@v1
with:
path: ./apps/docs
package-manager: pnpm@latest

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Use Node 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: Build documentation
run: pnpm build

- name:
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: apps/documentation/dist
clean: true
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
## Prerequisites

[Node.js](http://nodejs.org/) >= v14.17.0 must be installed.
[Node.js](http://nodejs.org/) >= 18.x must be installed.

## Installation

- Running `yarn install` in the component's root directory will install everything you need for development.
- Install [pnpm](https://pnpm.io/) globally using `npm install -g pnpm`

## Demo Development Server
- Run `pnpm install` to install the project dependencies.

- Running `yarn install:example` will install the documentation site.
## Demo Development Server

- `yarn watch:example` will run a documentation server with the component's demo app at [http://localhost:3000](http://localhost:3000) with hot module reloading.
- Run `pnpm start` to start the development server.
- Open `http://localhost:4321/react-sketch-canvas/` in your browser.

## Running Tests

- Install the documentation site using `yarn install:example
- `yarn e2e:ci` will run the tests once. `yarn e2e` will start the cypress test server.
- Run `pnpm test` to run the tests.

## Building

- `yarn build:prod` will build the component for publishing to npm.
- Run `pnpm build` to build the project.
3 changes: 2 additions & 1 deletion apps/docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import starlightTypeDoc, { typeDocSidebarGroup } from "starlight-typedoc";

// https://astro.build/config
export default defineConfig({
site: 'https://react-sketch-canvas.vercel.app/',
site: 'https://vinoth.info',
base: '/react-sketch-canvas',
integrations: [
starlight({
title: "React Sketch Canvas",
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "docs",
"name": "documentation",
"type": "module",
"private": true,
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/components/HomePageDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import paths from "../assets/initialSketch.json";
const iconButton =
"p-2 rounded-xl border cursor-pointer dark:border-accent-900 dark:text-accent-200";
const defaultIconButton =
"bg-transparent hover:bg-accent-100 dark:hover:bg-accent-800";
"bg-transparent text-accent-900 hover:bg-accent-100 dark:hover:bg-accent-800";

export function HomePageDemo() {
const [eraser, setEraser] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ hero:
file: ../../assets/logo.svg
actions:
- text: Get started
link: /guides/installation/
link: /react-sketch-canvas/guides/installation/
icon: right-arrow
variant: primary
- text: View on GitHub
Expand Down
24 changes: 0 additions & 24 deletions apps/documentation/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions apps/documentation/index.html

This file was deleted.

27 changes: 0 additions & 27 deletions apps/documentation/package.json

This file was deleted.

19 changes: 0 additions & 19 deletions apps/documentation/public/vite.svg

This file was deleted.

Loading

0 comments on commit 1e8f6a1

Please sign in to comment.