Skip to content
Merged

Docs #34

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Generate Docs

on:
push:
branches:
- main

concurrency:
group: pages
cancel-in-progress: false

jobs:
changes:
runs-on: ubuntu-latest
if: github.repository == 'greatsquare0/thy-weaver'

outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check if docs folder changed
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
docs:
- "packages/docs/**"

generate-docs:
permissions:
contents: read
pages: write
id-token: write
needs: changes
if: ${{steps.filter.outputs.docs == "true"}}
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depht: 0

- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "pnpm"

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm turbo run @thy-weaver/docs#dev

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: packages/docs/dist

deploy:
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: generate-docs
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
23 changes: 21 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,34 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
changes:
runs-on: ubuntu-latest
if: github.repository == 'greatsquare0/thy-weaver'

outputs:
docs: ${{ steps.filter.outputs.changeset }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check if changeset folder changed
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
changesets:
- ".changeset/**"

release:
permissions:
id-token: write # for provenance
contents: write
issues: write
pull-requests: write

if: ${{steps.filter.outputs.changeset == "true"}}
name: Release
if: github.repository == 'greatsquare0/thy-weaver'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand Down
1 change: 1 addition & 0 deletions packages/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cache
66 changes: 66 additions & 0 deletions packages/docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { defineConfig } from "vitepress";
import {
groupIconMdPlugin,
groupIconVitePlugin,
} from "vitepress-plugin-group-icons";
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Thy Weaver",
description: "A toolkit for making Twine games",
srcDir: "src/",
outDir: "dist/",
assetsDir: "static",
base: "/thy-weaver/",
markdown: {
config(md) {
md.use(groupIconMdPlugin);
},
},
vite: {
plugins: [groupIconVitePlugin()],
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: "/logo.svg",
nav: [
{ text: "Home", link: "/" },
{ text: "Guide", link: "/guide/getting-started" },
{ text: "Reference", link: "/reference/cli" },
],

sidebar: {
"/guide/": [
{
text: "Introduction",
items: [
{ text: "Why?", link: "/guide/index" },
{ text: "Getting Started", link: "/guide/getting-started" },
],
},
{
text: "Guide",
items: [
{ text: "Using Typescript", link: "/guide/using-typescript" },
{ text: "Manual Migration", link: "/guide/manual-migration" },
{ text: "Using TailwindCSS", link: "/guide/using-tailwind" },
{ text: "Importing Raw Files", link: "/guide/import-raw" },
],
},
],
"/reference/": [
{
text: "Reference",
items: [
{ text: "CLI", link: "/reference/cli" },
{ text: "Config File", link: "/reference/config-file" },
{ text: "File Structure", link: "/reference/file-structure" },
],
},
],
},

socialLinks: [
{ icon: "github", link: "https://github.com/vuejs/vitepress" },
],
},
});
5 changes: 5 additions & 0 deletions packages/docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import DefaultTheme from "vitepress/theme";

import "virtual:group-icons.css";

export default DefaultTheme;
17 changes: 17 additions & 0 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@thy-weaver/docs",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vitepress dev",
"build": "vitepress build",
"preview": "vitepress preview"
},
"author": "greatsquare0",
"license": "MIT",
"devDependencies": {
"vitepress": "^1.6.3",
"vitepress-plugin-group-icons": "^1.6.1"
}
}
Loading