Skip to content

Commit 53d96c8

Browse files
committed
init docs site
1 parent 0f67464 commit 53d96c8

File tree

19 files changed

+7477
-1
lines changed

19 files changed

+7477
-1
lines changed

.github/workflows/docs.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Docs
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/docs.yml'
9+
push:
10+
branches:
11+
- main
12+
- skarim/docs # temporary for testing
13+
paths:
14+
- 'docs/**'
15+
- '.github/workflows/docs.yml'
16+
17+
permissions:
18+
contents: read
19+
pages: write
20+
id-token: write
21+
22+
concurrency:
23+
group: "pages-${{ github.ref }}"
24+
cancel-in-progress: false
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '24'
37+
cache: 'npm'
38+
cache-dependency-path: 'docs/package-lock.json'
39+
40+
- name: Install dependencies
41+
working-directory: ./docs
42+
run: npm ci --legacy-peer-deps
43+
44+
- name: Build documentation
45+
working-directory: ./docs
46+
run: npm run build
47+
48+
- name: Upload build artifacts
49+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/skarim/docs' || github.event_name == 'workflow_dispatch'
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: ./docs/dist
53+
54+
deploy:
55+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/skarim/docs' || github.event_name == 'workflow_dispatch'
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
runs-on: ubuntu-latest
60+
needs: build
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: release
1+
name: Release
22

33
on:
44
push:

docs/.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# build output
2+
dist/
3+
4+
# generated types
5+
.astro/
6+
7+
# dependencies
8+
node_modules/
9+
10+
# logs
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# environment variables
17+
.env
18+
.env.local
19+
.env.production
20+
21+
# macOS-specific files
22+
.DS_Store

docs/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
legacy-peer-deps=true

docs/astro.config.mjs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
5+
// https://astro.build/config
6+
export default defineConfig({
7+
site: 'https://github.github.com',
8+
base: '/gh-stack/',
9+
trailingSlash: 'always',
10+
devToolbar: {
11+
enabled: false
12+
},
13+
integrations: [
14+
starlight({
15+
title: 'GitHub Stacked PRs',
16+
description: 'Manage stacked branches and pull requests with the gh stack CLI extension.',
17+
favicon: '/favicon.svg',
18+
customCss: [
19+
'./src/styles/custom.css',
20+
],
21+
social: [
22+
{ icon: 'github', label: 'GitHub', href: 'https://github.com/github/gh-stack' },
23+
],
24+
tableOfContents: {
25+
minHeadingLevel: 2,
26+
maxHeadingLevel: 4
27+
},
28+
pagination: true,
29+
expressiveCode: {
30+
frames: {
31+
showCopyToClipboardButton: true,
32+
},
33+
},
34+
sidebar: [
35+
{
36+
label: 'Introduction',
37+
items: [
38+
{ label: 'Overview', slug: 'introduction/overview' },
39+
],
40+
},
41+
{
42+
label: 'Getting Started',
43+
items: [
44+
{ label: 'Quick Start', slug: 'getting-started/quick-start' },
45+
],
46+
},
47+
{
48+
label: 'Guides',
49+
items: [
50+
{ label: 'Working with Stacked PRs', slug: 'guides/using-prs' },
51+
{ label: 'Typical Workflows', slug: 'guides/workflows' },
52+
],
53+
},
54+
{
55+
label: 'Reference',
56+
items: [
57+
{ label: 'CLI Commands', slug: 'reference/cli' },
58+
],
59+
},
60+
{
61+
label: 'FAQ',
62+
slug: 'faq',
63+
},
64+
],
65+
}),
66+
],
67+
});

0 commit comments

Comments
 (0)