chore: create astro docs cicd
This commit is contained in:
parent
a48925f6bc
commit
1ff86e237f
71
.github/workflows/jan-astro-docs.yml
vendored
71
.github/workflows/jan-astro-docs.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Deploy Astro Docs (v2)
|
name: Jan Astro Docs
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -11,58 +11,81 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- 'website/**'
|
- 'website/**'
|
||||||
- '.github/workflows/jan-astro-docs.yml'
|
- '.github/workflows/jan-astro-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
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy to v2.jan.ai
|
name: Deploy to CloudFlare Pages
|
||||||
env:
|
env:
|
||||||
# IMPORTANT: You will need to create a new Cloudflare Pages project
|
CLOUDFLARE_PROJECT_NAME: astro-docs
|
||||||
# and name it "jan-v2" or update this value to your new project name.
|
|
||||||
CLOUDFLARE_PROJECT_NAME: jan-v2
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write
|
||||||
deployments: write
|
deployments: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v4
|
- uses: actions/setup-node@v3
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
|
- uses: oven-sh/setup-bun@v2
|
||||||
|
|
||||||
|
- name: Install jq
|
||||||
|
uses: dcarbone/install-jq-action@v2.0.1
|
||||||
|
|
||||||
|
- name: Fill env vars
|
||||||
|
continue-on-error: true
|
||||||
|
working-directory: website
|
||||||
|
run: |
|
||||||
|
env_example_file=".env.example"
|
||||||
|
touch .env
|
||||||
|
while IFS= read -r line || [[ -n "$line" ]]; do
|
||||||
|
if [[ "$line" == *"="* ]]; then
|
||||||
|
var_name=$(echo $line | cut -d '=' -f 1)
|
||||||
|
echo $var_name
|
||||||
|
var_value="$(jq -r --arg key "$var_name" '.[$key]' <<< "$SECRETS")"
|
||||||
|
echo "$var_name=$var_value" >> .env
|
||||||
|
fi
|
||||||
|
done < "$env_example_file"
|
||||||
|
env:
|
||||||
|
SECRETS: '${{ toJson(secrets) }}'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: website
|
working-directory: website
|
||||||
run: npm install
|
run: bun install
|
||||||
|
- name: Build website
|
||||||
- name: Build Astro Docs
|
|
||||||
working-directory: website
|
working-directory: website
|
||||||
# No PUBLIC_BASE_PATH is set, so it builds for the root, which is correct for a subdomain
|
run: bun run build
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Publish to Cloudflare Pages (PR Preview)
|
- name: copy redirects and headers
|
||||||
|
continue-on-error: true
|
||||||
|
working-directory: website
|
||||||
|
run: |
|
||||||
|
cp _redirects dist/_redirects
|
||||||
|
cp _headers dist/_headers
|
||||||
|
|
||||||
|
- name: Publish to Cloudflare Pages PR Preview and Staging
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: cloudflare/pages-action@v1
|
uses: cloudflare/pages-action@v1
|
||||||
id: deployPreview
|
|
||||||
with:
|
with:
|
||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
|
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
|
||||||
directory: ./website/dist
|
directory: ./website/dist
|
||||||
|
# Optional: Enable this if you want to have GitHub Deployments triggered
|
||||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
id: deployCloudflarePages
|
||||||
|
|
||||||
- name: Add PR Comment with Preview URL
|
- uses: mshick/add-pr-comment@v2
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: mshick/add-pr-comment@v2
|
|
||||||
with:
|
with:
|
||||||
message: |
|
message: |
|
||||||
🚀 Astro docs preview is ready!
|
Preview URL Astro Docs: ${{ steps.deployCloudflarePages.outputs.url }}
|
||||||
URL: ${{ steps.deployPreview.outputs.url }}
|
|
||||||
|
|
||||||
- name: Publish to Cloudflare Pages (Production)
|
- name: Publish to Cloudflare Pages Production
|
||||||
if: (github.event_name == 'push' && github.ref == 'refs/heads/dev') || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/dev')
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/dev') || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/dev')
|
||||||
uses: cloudflare/pages-action@v1
|
uses: cloudflare/pages-action@v1
|
||||||
with:
|
with:
|
||||||
@ -70,6 +93,6 @@ jobs:
|
|||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
|
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
|
||||||
directory: ./website/dist
|
directory: ./website/dist
|
||||||
# This deploys to the production branch of your new Cloudflare project
|
|
||||||
branch: main
|
branch: main
|
||||||
|
# Optional: Enable this if you want to have GitHub Deployments triggered
|
||||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
6
.gitignore
vendored
6
.gitignore
vendored
@ -77,3 +77,9 @@ docs/.next/
|
|||||||
|
|
||||||
# Combined output for local testing
|
# Combined output for local testing
|
||||||
combined-output/
|
combined-output/
|
||||||
|
|
||||||
|
# vscode
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
# yarn
|
||||||
|
.yarnrc.yml
|
||||||
@ -1,3 +0,0 @@
|
|||||||
nmHoistingLimits: workspaces
|
|
||||||
nodeLinker: node-modules
|
|
||||||
checksumBehavior: update
|
|
||||||
4
website/.vscode/extensions.json
vendored
4
website/.vscode/extensions.json
vendored
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"recommendations": ["astro-build.astro-vscode"],
|
|
||||||
"unwantedRecommendations": []
|
|
||||||
}
|
|
||||||
11
website/.vscode/launch.json
vendored
11
website/.vscode/launch.json
vendored
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"command": "./node_modules/.bin/astro dev",
|
|
||||||
"name": "Development server",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "node-terminal"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -303,4 +303,4 @@ When adding new components or effects:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
*Created with ❤️ and a healthy dose of 80s nostalgia*
|
*Created with ❤️ and a healthy dose of 80s nostalgia*
|
||||||
|
|||||||
@ -96,6 +96,7 @@ export default defineConfig({
|
|||||||
{
|
{
|
||||||
label: 'Local Server',
|
label: 'Local Server',
|
||||||
items: [
|
items: [
|
||||||
|
{ label: 'Introduction', link: '/local-server/' },
|
||||||
{ label: 'Server Setup', slug: 'local-server/api-server' },
|
{ label: 'Server Setup', slug: 'local-server/api-server' },
|
||||||
{
|
{
|
||||||
label: 'Jan Data Folder',
|
label: 'Jan Data Folder',
|
||||||
|
|||||||
@ -9,8 +9,9 @@
|
|||||||
"astro": "^5.6.1",
|
"astro": "^5.6.1",
|
||||||
"astro-mermaid": "^1.0.4",
|
"astro-mermaid": "^1.0.4",
|
||||||
"gsap": "^3.13.0",
|
"gsap": "^3.13.0",
|
||||||
|
"mermaid": "^11.9.0",
|
||||||
"phosphor-astro": "^2.1.0",
|
"phosphor-astro": "^2.1.0",
|
||||||
"sharp": "^0.34.2",
|
"sharp": "^0.34.3",
|
||||||
"starlight-openapi": "^0.19.1",
|
"starlight-openapi": "^0.19.1",
|
||||||
"starlight-sidebar-topics": "^0.6.0",
|
"starlight-sidebar-topics": "^0.6.0",
|
||||||
"starlight-theme-rapide": "^0.5.1",
|
"starlight-theme-rapide": "^0.5.1",
|
||||||
|
|||||||
@ -15,11 +15,13 @@
|
|||||||
"astro": "^5.6.1",
|
"astro": "^5.6.1",
|
||||||
"astro-mermaid": "^1.0.4",
|
"astro-mermaid": "^1.0.4",
|
||||||
"gsap": "^3.13.0",
|
"gsap": "^3.13.0",
|
||||||
|
"mermaid": "^11.9.0",
|
||||||
"phosphor-astro": "^2.1.0",
|
"phosphor-astro": "^2.1.0",
|
||||||
"sharp": "^0.34.2",
|
"sharp": "^0.34.3",
|
||||||
"starlight-openapi": "^0.19.1",
|
"starlight-openapi": "^0.19.1",
|
||||||
"starlight-sidebar-topics": "^0.6.0",
|
"starlight-sidebar-topics": "^0.6.0",
|
||||||
"starlight-theme-rapide": "^0.5.1",
|
"starlight-theme-rapide": "^0.5.1",
|
||||||
"starlight-videos": "^0.3.0"
|
"starlight-videos": "^0.3.0"
|
||||||
}
|
},
|
||||||
|
"packageManager": "yarn@1.22.22"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ For an overview of Jan Local Server, see the [Local Server introduction](./index
|
|||||||
|
|
||||||
## API Usage
|
## API Usage
|
||||||
|
|
||||||
```jan/website/src/content/docs/local-server/api-server.mdx#L69-80
|
```bash
|
||||||
curl http://127.0.0.1:1337/v1/chat/completions \
|
curl http://127.0.0.1:1337/v1/chat/completions \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: Bearer testing-something" \
|
-H "Authorization: Bearer testing-something" \
|
||||||
|
|||||||
@ -6,7 +6,6 @@ sidebar:
|
|||||||
banner:
|
banner:
|
||||||
content: 'In Development: This tool is planned and not yet available.'
|
content: 'In Development: This tool is planned and not yet available.'
|
||||||
---
|
---
|
||||||
import { Aside, Card, CardGrid } from '@astrojs-starlight/components';
|
|
||||||
|
|
||||||
## Let Jan Use Your Browser
|
## Let Jan Use Your Browser
|
||||||
|
|
||||||
@ -14,9 +13,9 @@ import { Aside, Card, CardGrid } from '@astrojs-starlight/components';
|
|||||||
|
|
||||||
Think of it as an integrated, privacy-first automation layer that turns Jan from a conversational AI into a powerful agent for action.
|
Think of it as an integrated, privacy-first automation layer that turns Jan from a conversational AI into a powerful agent for action.
|
||||||
|
|
||||||
<Aside type="note">
|
:::note
|
||||||
**This tool is not yet available.** We are designing `BrowserUse` to be a core component of Jan's agentic capabilities.
|
**This tool is not yet available.** We are designing `BrowserUse` to be a core component of Jan's agentic capabilities.
|
||||||
</Aside>
|
:::
|
||||||
|
|
||||||
### Inspired by the Best
|
### Inspired by the Best
|
||||||
|
|
||||||
@ -26,11 +25,10 @@ While tools like [Browser Use](https://docs.browser-use.com/introduction) exist
|
|||||||
|
|
||||||
The tool will be implemented as a native **Model Context Protocol (MCP)** server within Jan, ensuring secure and standardized communication between the AI model and the browser. This allows for powerful, auditable, and secure web interactions.
|
The tool will be implemented as a native **Model Context Protocol (MCP)** server within Jan, ensuring secure and standardized communication between the AI model and the browser. This allows for powerful, auditable, and secure web interactions.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Planned Core Features:
|
### Planned Core Features:
|
||||||
- **Secure Sessions**: All browsing activity happens in an isolated, sandboxed environment.
|
- **Secure Sessions**: All browsing activity happens in an isolated, sandboxed environment.
|
||||||
- **Natural Language Control**: Simply tell Jan what you want to do (e.g., "Book a flight," "Research this topic and summarize the top 5 findings," "Apply for this job for me").
|
- **Natural Language Control**: Simply tell Jan what you want to do (e.g., "Book a flight," "Research this topic and summarize the top 5 findings," "Apply for this job for me").
|
||||||
- **Visual Understanding**: Jan will be able to see and interpret the content on pages, not just the underlying code.
|
- **Visual Understanding**: Jan will be able to see and interpret the content on pages, not just the underlying code.
|
||||||
- **User in the Loop**: Always ask for permission before taking critical actions like submitting forms or making purchases.
|
- **User in the Loop**: Always ask for permission before taking critical actions like submitting forms or making purchases.
|
||||||
|
|
||||||
|
---
|
||||||
Loading…
x
Reference in New Issue
Block a user