Skip to content

New Documentation for Cortex #2192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open
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
71 changes: 60 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,32 @@ on:
push:
branches:
- dev
- main
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
pull_request:
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
schedule:
- cron: "0 22 * * 1,2,3,4,5,6"
workflow_dispatch:

permissions:
contents: write
deployments: write
pull-requests: write
pages: write
id-token: write

jobs:
deploy:
name: Deploy to Cloudflare Pages
deploy-docusaurus:
name: Deploy Docusaurus to Cloudflare Pages
env:
CLOUDFLARE_PROJECT_NAME: cortex-docs
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
pull-requests: write
if: false # Disable this job if you've fully migrated to Astro
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -72,15 +76,14 @@ jobs:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
directory: ./docs/build
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
id: deployCloudflarePages

- uses: mshick/add-pr-comment@v2
if: github.event_name == 'pull_request'
with:
message: |
Preview URL: ${{ steps.deployCloudflarePages.outputs.url }}
Docusaurus Preview URL: ${{ steps.deployCloudflarePages.outputs.url }}

- name: Publish to Cloudflare Pages Production
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/dev' && github.event.pull_request.head.repo.full_name != github.repository
Expand All @@ -91,5 +94,51 @@ jobs:
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
directory: ./docs/build
branch: main
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

build-astro:
name: Build Astro Site
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install, build, and upload Astro site
uses: withastro/action@v3
with:
path: ./docs
# If you're using Bun, specify it
package-manager: bun@latest

deploy-astro:
name: Deploy Astro to GitHub Pages
needs: build-astro
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

deploy-astro-pr-preview:
name: Deploy PR Preview
needs: build-astro
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: write
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
preview: true
- name: Add PR comment with preview URL
uses: mshick/add-pr-comment@v2
with:
message: |
📝 Documentation Preview: ${{ steps.deployment.outputs.page_url }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ docs/.yarn/
docs/.yarnrc.yml
docs/bun.lockb
docs/yarn.lock
archive/
3 changes: 0 additions & 3 deletions docs/.env.example

This file was deleted.

31 changes: 15 additions & 16 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# Dependencies
/node_modules
# build output
dist/
# generated types
.astro/

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

.env

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
2 changes: 0 additions & 2 deletions docs/.prettierignore

This file was deleted.

71 changes: 35 additions & 36 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
# Website
# Starlight Starter Kit: Basics

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)

```
$ yarn start
bun create astro@latest -- --template starlight
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs)

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!

### Deployment
## 🚀 Project Structure

Using SSH:
Inside of your Astro + Starlight project, you'll see the following folders and files:

```
$ USE_SSH=true yarn deploy
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ └── content.config.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

Not using SSH:
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.

```
$ GIT_USER=<Your GitHub username> yarn deploy
```
Images can be added to `src/assets/` and embedded in Markdown with a relative link.

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
Static assets, like favicons, can be placed in the `public/` directory.

## Changelog Generator
## 🧞 Commands

To generate a changelog post, run:
All commands are run from the root of the project, from a terminal:

```bash
yarn create:changelog
```
| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `bun install` | Installs dependencies |
| `bun dev` | Starts local dev server at `localhost:4321` |
| `bun build` | Build your production site to `./dist/` |
| `bun preview` | Preview your build locally, before deploying |
| `bun astro ...` | Run CLI commands like `astro add`, `astro check` |
| `bun astro -- --help` | Get help using the Astro CLI |

- **Title & Slug**: Generate changelog post files with a title and a slug.
- **Description**: Add a description for the changelog post.
- **Version**: Add a version for the changelog post.
## 👀 Want to learn more?

The pages will be generated in `changelog/${slug}`. You can start writing your changelog post here.
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
Loading