Skip to content

Commit

Permalink
Merge pull request #1 from basemind-ai/feat-add-workflows
Browse files Browse the repository at this point in the history
chore: add workflows
  • Loading branch information
Goldziher authored Dec 18, 2023
2 parents e3f3e0d + 2e68703 commit 41df981
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
48 changes: 48 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install PNPM
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 8
run_install: false
- name: Setup Cache
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Load Cached Dependencies
uses: actions/cache@v3
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 --ignore-scripts
- name: Lint
run: pnpm run lint
- name: Format
run: pnpm run format
- name: Spellcheck
run: pnpm run spellcheck
- name: Type Check
run: pnpm run typecheck
52 changes: 52 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy

on:
push:
branches:
- main

permissions:
contents: write

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install PNPM
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 8
run_install: false
- name: Setup Cache
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Load Cached Dependencies
uses: actions/cache@v3
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 --ignore-scripts
- name: Build
run: pnpm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
20 changes: 20 additions & 0 deletions .github/workflows/pr-title.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Lint PR Title'

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build Test

on:
pull_request:
branches:
- main
jobs:
build_test:
name: Build Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install PNPM
uses: pnpm/[email protected]
id: pnpm-install
with:
version: 8
run_install: false
- name: Setup Cache
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Load Cached Dependencies
uses: actions/cache@v3
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 --ignore-scripts
- name: Build
run: pnpm run build
15 changes: 10 additions & 5 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ import type * as Preset from '@docusaurus/preset-classic';
import type { Config } from '@docusaurus/types';
import { themes as prismThemes } from 'prism-react-renderer';

const basemind = 'BaseMind.AI';
const deploymentBranch = 'gh-pages';
const discordInviteLink = 'https://discord.gg/ReZ9SZwvwu';
const docsSiteUrl = 'https://your-docusaurus-site.example.com';
const logo = 'img/logo.svg';
const organizationName = 'BaseMind.AI';
const organizationName = 'basemind-ai';
const repositoryName = 'docs';

const config: Config = {
baseUrl: '/',
deploymentBranch,
favicon: 'img/favicon.ico',
i18n: {
defaultLocale: 'en',
Expand All @@ -32,7 +36,7 @@ const config: Config = {
} satisfies Preset.Options,
],
],
projectName: organizationName,
projectName: repositoryName,
tagline: '',
themeConfig: {
image: 'img/log-with-text.png',
Expand All @@ -52,17 +56,18 @@ const config: Config = {
},
],
logo: {
alt: `${organizationName} Logo`,
alt: `${basemind} Logo`,
src: logo,
},
title: organizationName,
title: basemind,
},
prism: {
darkTheme: prismThemes.dracula,
theme: prismThemes.github,
},
} satisfies Preset.ThemeConfig,
title: organizationName,
title: basemind,
trailingSlash: false,
url: docsSiteUrl,
};

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"dependencies": {
"@docusaurus/core": "3.0.1",
"@docusaurus/preset-classic": "3.0.1",
"@docusaurus/theme-classic": "^3.0.1",
"@mdx-js/react": "^3.0.0",
"@types/node": "^20.10.5",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.3.0",
"react": "^18.2.0",
Expand Down
8 changes: 7 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 41df981

Please sign in to comment.