Skip to content

Commit b7e5724

Browse files
Sagar VelankarSagar Velankar
authored andcommitted
add nextra documentation website
1 parent 0f8ffb7 commit b7e5724

26 files changed

+4979
-31
lines changed

.github/workflows/cicd_pipeline.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI/CD pipeline
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ['release/1.0']
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: 'pages'
21+
cancel-in-progress: false
22+
23+
jobs:
24+
# Build job
25+
build-documentation:
26+
runs-on: ubuntu-latest
27+
steps:
28+
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Install pnpm
33+
uses: pnpm/action-setup@v4
34+
with:
35+
version: 9
36+
package_json_file: docs/package.json
37+
run_install: false
38+
39+
- name: Setup Node
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '22'
43+
cache: 'pnpm'
44+
cache-dependency-path: docs/pnpm-lock.yaml
45+
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v5
48+
with:
49+
static_site_generator: next
50+
51+
- name: Restore cache
52+
uses: actions/cache@v4
53+
with:
54+
path: ./docs/.next/cache
55+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
56+
restore-keys: |
57+
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
58+
59+
- name: Install dependencies
60+
run: cd "${{ github.workspace }}/docs" && pnpm install
61+
62+
- name: Build with Next.js
63+
run: cd "${{ github.workspace }}/docs" && pnpm run build
64+
65+
- name: Upload artifact
66+
uses: actions/upload-pages-artifact@v3
67+
with:
68+
path: ./docs/out
69+
70+
# Deployment job
71+
deploy-documentation:
72+
environment:
73+
name: github-pages
74+
url: ${{ steps.deployment.outputs.page_url }}
75+
runs-on: ubuntu-latest
76+
needs: build
77+
steps:
78+
- name: Deploy to GitHub Pages
79+
id: deployment
80+
uses: actions/deploy-pages@v4

.vscode/tasks.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,30 @@
1919
"label": "Run with opentelemetry",
2020
"problemMatcher": [],
2121
"type": "shell"
22-
}
22+
},
23+
{
24+
"command": "pnpm dev",
25+
"group": {
26+
"isDefault": true,
27+
"kind": "build"
28+
},
29+
"label": "Start documentation website in development mode",
30+
"options": {
31+
"cwd": "docs"
32+
},
33+
"type": "shell"
34+
},
35+
{
36+
"command": "pnpm i",
37+
"group": {
38+
"kind": "build"
39+
},
40+
"label": "Install dependencies for documentation website",
41+
"options": {
42+
"cwd": "docs"
43+
},
44+
"type": "shell"
45+
},
2346
],
2447
"version": "2.0.0"
2548
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/pages/docs/index.mdx

docs/.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
!.vscode/tasks.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?
26+
27+
/node_modules/
28+
/lib/
29+
/test/
30+
custom-elements.json
31+
/bin/
32+
/internal/
33+
/src/annotative/highlight.js
34+
/src/annotative/styles/css
35+
/src/annotative/constants/*.json
36+
37+
/.next/
38+
/out/

docs/.gitkeep

Whitespace-only changes.

docs/next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

docs/next.config.mjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import nextra from 'nextra'
2+
3+
const withNextra = nextra({
4+
theme: 'nextra-theme-docs',
5+
themeConfig: './theme.config.tsx',
6+
latex: true,
7+
flexsearch: {
8+
codeblocks: false
9+
},
10+
defaultShowCopyCode: true
11+
});
12+
13+
export default withNextra({
14+
basePath: '/devops-cicd-pipeline-code-generator',
15+
output: 'export',
16+
images: {
17+
unoptimized: true,
18+
},
19+
reactStrictMode: true,
20+
redirects: () => [
21+
{
22+
source: '/',
23+
destination: '/docs',
24+
permanent: true
25+
}
26+
]
27+
})

docs/package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "devops-cicd-pipeline-code-generator",
3+
"version": "1.0.0",
4+
"description": "DevOps CI/CD pipeline code generator",
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/devopscodegen/devops-cicd-pipeline-code-generator.git"
13+
},
14+
"author": "Sagar Velankar <[email protected]>",
15+
"license": "MIT",
16+
"bugs": {
17+
"url": "https://github.com/devopscodegen/devops-cicd-pipeline-code-generator/issues"
18+
},
19+
"homepage": "https://devopscodegen.github.io/devops-cicd-pipeline-code-generator",
20+
"dependencies": {
21+
"@next/third-parties": "14",
22+
"next": "^14",
23+
"nextra": "^2",
24+
"nextra-theme-docs": "^2",
25+
"react": "^18",
26+
"react-dom": "^18"
27+
},
28+
"devDependencies": {
29+
"@types/node": "^22",
30+
"typescript": "^5",
31+
"postcss": "^8",
32+
"tailwindcss": "^3",
33+
"autoprefixer": "^10"
34+
}
35+
}

docs/pages/404.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { NotFoundPage } from 'nextra-theme-docs'
2+
3+
# 404: Page Not Found
4+
5+
<NotFoundPage />

docs/pages/_app.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { GoogleAnalytics } from '@next/third-parties/google';
2+
import '../style.css';
3+
4+
export default function MyApp({ Component, pageProps }) {
5+
return (
6+
<>
7+
<Component {...pageProps} />
8+
<GoogleAnalytics gaId="GTM-NF267TL6" />
9+
</>
10+
);
11+
}

0 commit comments

Comments
 (0)