Skip to content

Commit

Permalink
Docs: πŸ“ Move docs generator to Starlight and typedoc (#2717)
Browse files Browse the repository at this point in the history
* Docs: πŸ“ Move docs generator to Starlight and typedoc

* Docs: πŸ“ Add deployable implementation via fly.io

* Docs: πŸ‘· Fix configuration on typedoc generation

* Docs: πŸ“ Add additional pro and docker docs

* Docs: βž• Add one compose file

* Docs: βž– Remove jsdoc and update links to new url
  • Loading branch information
chuckcarpenter committed Apr 26, 2024
1 parent acd60b5 commit f147533
Show file tree
Hide file tree
Showing 42 changed files with 1,850 additions and 1,156 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Docs CD Deploy
on:
push:
branches:
- main
paths:
- 'docs-src/**'

jobs:
deploy:
name: Deploy Docs
runs-on: ubuntu-latest
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: |
flyctl deploy --config docs-src/fly.toml --dockerfile docs-src/Dockerfile
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
2 changes: 0 additions & 2 deletions .github/workflows/publish-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:
env:
PUBLIC_SHEPHERD_PUBLIC_KEY: ${{ secrets.PUBLIC_SHEPHERD_PUBLIC_KEY }}
PUBLIC_SHEPHERD_FRONTEND_API: ${{ secrets.PUBLIC_SHEPHERD_FRONTEND_API }}
- name: Build docs
run: pnpm run docs
- name: Publish site and docs
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
53 changes: 0 additions & 53 deletions .jsdoc.js

This file was deleted.

60 changes: 0 additions & 60 deletions app/docker-compose.dev.yml

This file was deleted.

61 changes: 0 additions & 61 deletions app/docker-compose.prod.yml

This file was deleted.

36 changes: 36 additions & 0 deletions app/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
services:
redwood:
build:
context: .
volumes:
- .:/app
- yarn_cache:/root/.yarn/berry/cache
- node_cache:/root/.cache
ports:
- "8910:8910"
depends_on:
- db
environment:
DATABASE_URL: postgresql://redwood:redwood@db:5432/redwood
DIRECT_URL: postgresql://redwood:redwood@db:5432/redwood
TEST_DATABASE_URL: postgresql://redwood:redwood@db:5432/redwood_test
SESSION_SECRET: super_secret_session_key_change_me_in_production_please
POSTHOG_API_KEY: "POSTHOG_API_KEY"
SHEPHERD_PUBLIC_KEY: "SHEPHERD_PUBLIC_KEY"
NODE_ENV: production

db:
image: postgres:16-bookworm
environment:
POSTGRES_USER: redwood
POSTGRES_PASSWORD: redwood
POSTGRES_DB: redwood
ports:
- "5432:5432"
volumes:
- postgres:/var/lib/postgresql/data

volumes:
yarn_cache:
node_cache:
postgres:
4 changes: 2 additions & 2 deletions app/web/src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const categories = [
items: [
{ route: 'https://github.com/shepherd-pro/shepherd', title: 'Github' },
{ route: 'https://shepherdjs.dev', title: 'Open Source Demo' },
{ route: 'https://shepherdjs.dev/signin', title: 'Open Source Docs' },
{ route: 'https://shepherdjs.dev/signup', title: 'Blog' },
{ route: 'https://docs.shepherdpro.com/', title: 'Open Source Docs' },
{ route: 'https://shepherdjs.dev/blog', title: 'Blog' },
],
},
// {
Expand Down
11 changes: 8 additions & 3 deletions app/web/src/components/Navigation/UserMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { DocumentDuplicateIcon, PowerIcon, CogIcon, UserIcon } from '@heroicons/react/24/solid';
import {
DocumentDuplicateIcon,
PowerIcon,
CogIcon,
UserIcon,
} from '@heroicons/react/24/solid';

import { NavLink, routes } from '@redwoodjs/router';

Expand All @@ -11,8 +16,8 @@ export default function UserMenu() {
<ul className="space-y-1">
<li>
<a
href='https://shepherdjs.dev/docs'
target='_blank'
href="https://docs.shepherdpro.com/"
target="_blank"
className="group flex w-full gap-x-3 rounded-md p-2 px-6 text-sm font-semibold leading-6 hover:bg-violet-50 hover:text-violet-600"
>
<DocumentDuplicateIcon className="h-6 w-6 group-hover:text-violet-600" />{' '}
Expand Down
21 changes: 21 additions & 0 deletions docs-src/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

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


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
24 changes: 24 additions & 0 deletions docs-src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# generated api docs
src/content/docs/api/*

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


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
4 changes: 4 additions & 0 deletions docs-src/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions docs-src/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
52 changes: 52 additions & 0 deletions docs-src/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# syntax = docker/dockerfile:1

# Adjust NODE_VERSION as desired
ARG NODE_VERSION=20.10.0
FROM node:${NODE_VERSION}-slim as base

LABEL fly_launch_runtime="Astro"

# Astro app lives here
WORKDIR /app

# Set production environment
ENV NODE_ENV="production"

# Install pnpm
ARG PNPM_VERSION=8.15.6
RUN npm install -g pnpm@$PNPM_VERSION


# Throw-away build stage to reduce size of final image
FROM base as build

# Install packages needed to build node modules
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3

# Install node modules
COPY --link package.json pnpm-lock.yaml pnpm-workspace.yaml ./

# Copy library code
COPY --link ./shepherd.js ./shepherd.js

# Copy application code
COPY --link ./docs-src ./docs-src
RUN pnpm install --frozen-lockfile --prod=false

# Build application
RUN pnpm -F shepherd-docs run build

# Remove development dependencies
RUN pnpm prune --prod


# Final stage for app image
FROM nginx

# Copy built application
COPY --from=build /app/docs-src/dist /usr/share/nginx/html

# Start the server by default, this can be overwritten at runtime
EXPOSE 80
CMD [ "/usr/sbin/nginx", "-g", "daemon off;" ]
Loading

0 comments on commit f147533

Please sign in to comment.