Skip to content

Commit f0a1d00

Browse files
authored
Add AI Chat (#29)
1 parent d6f5d89 commit f0a1d00

15 files changed

Lines changed: 695 additions & 430 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ updates:
33
- package-ecosystem: "github-actions"
44
directory: "/"
55
schedule:
6-
interval: "weekly"
6+
interval: "monthly"
77
#open-pull-requests-limit: 1
88

99
- package-ecosystem: "npm"
1010
directory: "/"
1111
schedule:
12-
interval: "weekly"
12+
interval: "monthly"
1313
#open-pull-requests-limit: 1

.github/workflows/dev.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
path: ".vitepress/dist"
2727
secrets:
2828
webhook: ${{ secrets.DISCORD_WEBHOOK }}
29+
ai_chat_api: ${{ secrets.AI_CHAT_API }}
30+
ai_chat_auth: ${{ secrets.AI_CHAT_AUTH }}
2931

3032
deploy:
3133
name: "Deploy"

.github/workflows/lint.yaml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: "Lint"
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches: [master]
75
pull_request:
86
branches: [master]
7+
push:
8+
branches: [master]
99

1010
concurrency:
1111
group: ${{ github.workflow }}-${{ github.ref }}
@@ -22,19 +22,36 @@ jobs:
2222
- name: "Checkout"
2323
uses: actions/checkout@v6
2424

25+
- name: "Debug event.json"
26+
if: ${{ !github.event.act }}
27+
continue-on-error: true
28+
run: cat "${GITHUB_EVENT_PATH}"
29+
- name: "Debug CTX github"
30+
if: ${{ !github.event.act }}
31+
continue-on-error: true
32+
env:
33+
GITHUB_CTX: ${{ toJSON(github) }}
34+
run: echo "$GITHUB_CTX"
35+
- name: "Debug Environment"
36+
if: ${{ !github.event.act }}
37+
continue-on-error: true
38+
run: env
39+
2540
- name: "Setup Node 24"
2641
uses: actions/setup-node@v6
2742
with:
2843
node-version: 24
2944

3045
- name: "Install"
31-
id: install
3246
run: npm ci
3347

48+
- name: "Build"
49+
if: ${{ !cancelled() }}
50+
run: npm run build
51+
3452
#- name: "eslint"
3553
# if: ${{ !cancelled() }}
36-
# run: |
37-
# npm run lint
54+
# run: npm run lint
3855

3956
- name: "prettier"
4057
if: ${{ !cancelled() }}
@@ -53,3 +70,5 @@ jobs:
5370
- name: "actionlint"
5471
if: ${{ !cancelled() }}
5572
uses: cssnr/actionlint-action@v1
73+
with:
74+
shellcheck_opts: -e SC2129

.github/workflows/pages.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ jobs:
3030
build: "npm run build"
3131
path: ".vitepress/dist"
3232
pages: true
33+
secrets:
34+
webhook: ${{ secrets.DISCORD_WEBHOOK }}
35+
ai_chat_api: ${{ secrets.AI_CHAT_API }}
36+
ai_chat_auth: ${{ secrets.AI_CHAT_AUTH }}
3337

3438
deploy:
3539
name: "Deploy"

.gitignore

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
# Generic
12
.idea/
23
*.iml
34
.vscode/
4-
**/dist/
5+
cache/
6+
dist/
57
build/
68
node_modules/
7-
.vitepress/cache
8-
.vitepress/contributors.json
9+
web-ext-artifacts/
10+
*.tsbuildinfo
11+
# VitePress
12+
contributors.json
13+
.env
14+
.env.development

.prettierrc.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
2-
"trailingComma": "es5",
2+
"$schema": "https://json.schemastore.org/prettierrc",
33
"semi": false,
44
"singleQuote": true,
5-
"printWidth": 110,
5+
"printWidth": 120,
66
"overrides": [
77
{
8-
"files": ["**/*.html", "**/*.yaml", "**/*.yml"],
8+
"files": ["**/*.vue"],
99
"options": {
10-
"singleQuote": false
10+
"printWidth": 120
1111
}
1212
},
1313
{
14-
"files": ["**/*.js", "**/*.css", "**/*.scss"],
14+
"files": ["**/*.html", "**/*.yaml", "**/*.yml"],
1515
"options": {
16-
"tabWidth": 4
16+
"singleQuote": false,
17+
"printWidth": 120
1718
}
1819
}
1920
]

.vitepress/config.mts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { defineConfig } from 'vitepress'
22
import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons'
3+
import vitePressInstructions from '@cssnr/vitepress-chat/instructions-plugin'
4+
5+
// import llmstxt from 'vitepress-plugin-llms'
36

47
const settings = {
58
siteTitle: 'Portainer Deploy', // For Site Sidebar
@@ -16,16 +19,22 @@ const settings = {
1619
actions_url: 'https://github.com/marketplace/actions/portainer-stack-deploy-action',
1720
}
1821

22+
const llmExcludes = ['index.md', 'guides/examples.md', 'guides/features.md', 'guides/include/**/*']
23+
1924
// https://vitepress.dev/reference/site-config
2025
// noinspection JSUnusedGlobalSymbols
2126
export default defineConfig({
2227
srcDir: './docs',
2328
// base: '/path/',
2429
vite: {
30+
envDir: '..',
2531
server: {
2632
allowedHosts: true,
2733
},
2834
plugins: [
35+
// llmstxt(),
36+
vitePressInstructions({ exclude: llmExcludes }),
37+
2938
groupIconVitePlugin({
3039
customIcon: {
3140
git: 'vscode-icons:file-type-git',

.vitepress/theme/custom.css

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
:root {
2-
--vp-home-hero-name-color: transparent;
3-
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #ff80f2, 30%, #c080ff);
4-
--vp-home-hero-image-background-image: linear-gradient(0deg, #c080ff, #c080ff);
5-
--vp-home-hero-image-filter: blur(72px);
2+
--vp-home-hero-name-color: transparent;
3+
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #ff80f2, 30%, #c080ff);
4+
--vp-home-hero-image-background-image: linear-gradient(0deg, #c080ff, #c080ff);
5+
--vp-home-hero-image-filter: blur(72px);
66

7-
--vp-sidebar-width: 230px; /* Custom Sidebar Width */
8-
--vp-button-alt-bg: var(--vp-c-default-1);
7+
--vp-sidebar-width: 230px; /* Custom Sidebar Width */
8+
--vp-button-alt-bg: var(--vp-c-default-1);
99
}
1010

1111
body {
12-
overflow-y: scroll;
12+
overflow-y: scroll;
1313
}
1414

1515
summary {
16-
cursor: pointer;
16+
cursor: pointer;
1717
}
1818

1919
table th {
20-
text-wrap: nowrap;
20+
text-wrap: nowrap;
2121
}
2222

2323
.search-keywords {
24-
display: none;
24+
display: none;
2525
}
2626

2727
/* NOTE: This is a "fix" for the search modal content shift */
2828
@supports (scrollbar-gutter: stable) {
29-
@media (min-width: 769px) {
30-
html {
31-
scrollbar-gutter: stable;
32-
}
29+
/* Note: local search is: 768px */
30+
@media (min-width: 769px) {
31+
html {
32+
scrollbar-gutter: stable;
3333
}
34+
html:has(:fullscreen) {
35+
scrollbar-gutter: auto;
36+
}
37+
}
3438
}
3539

3640
.vp-doc p > img,
3741
.vp-doc p > a > img {
38-
display: inline-block;
39-
margin-right: 8px;
42+
display: inline-block;
43+
margin-right: 8px;
4044
}
Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import './custom.css'
66
import StackTable from './components/StackTable.vue'
77
import LatestVersion from './components/LatestVersion.vue'
88

9+
import VitePressChat from '@cssnr/vitepress-chat'
10+
import '@cssnr/vitepress-chat/style.css'
11+
912
import CopyButton from '@cssnr/vitepress-plugin-copybutton'
1013
import '@cssnr/vitepress-plugin-copybutton/style.css'
1114

@@ -17,15 +20,20 @@ import contributors from '../contributors.json'
1720
// noinspection JSUnusedGlobalSymbols
1821
/** @type {import('vitepress').Theme} */
1922
export default {
20-
...DefaultTheme,
23+
...DefaultTheme,
24+
25+
...VitePressChat(DefaultTheme, {
26+
api: import.meta.env.VITE_AI_API,
27+
headers: import.meta.env.VITE_AI_AUTH ? { Authorization: import.meta.env.VITE_AI_AUTH } : undefined,
28+
}),
2129

22-
enhanceApp({ app }) {
23-
app.component('Badge', VPBadge)
24-
app.component('StackTable', StackTable)
25-
app.component('LatestVersion', LatestVersion)
30+
enhanceApp({ app }) {
31+
app.component('Badge', VPBadge)
32+
app.component('StackTable', StackTable)
33+
app.component('LatestVersion', LatestVersion)
2634

27-
app.component('CB', CopyButton)
28-
app.component('Contributors', Contributors)
29-
app.config.globalProperties.$contributors = contributors
30-
},
35+
app.component('CB', CopyButton)
36+
app.component('Contributors', Contributors)
37+
app.config.globalProperties.$contributors = contributors
38+
},
3139
}

.vitepress/vars.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@
55
* @type {string[]} user/repo
66
*/
77
export const repos = [
8-
'cssnr/portainer-stack-deploy-action',
9-
'carlrygart/portainer-stack-deploy',
10-
'kgierke/portainer-stack-deployment',
11-
'nvti/portainer-stack-deploy',
12-
'LGinC/portainer-stack-deploy',
13-
'BramKelchtermans/portainer-deploy-action',
14-
'newarifrh/portainer-service-webhook',
15-
'wirgen/portainer-stack-redeploy-action',
16-
'bots-house/portainer-deploy-stack-action',
17-
'luminos-company/portami',
18-
'Hugollemos/deploy',
19-
'rrennoir/portainer-stack',
20-
'sdjnmxd/portainer-stack-deploy',
21-
'Filaind/portainer-stack-deploy',
22-
'robin-moser/portainer-stack-deploy',
23-
'spawnlab-dev/stack-deploy-action',
24-
'nevcodia/portainer-stack-deployment',
25-
// 'scod-br/portainer-stack-deploy',
26-
'dann41/portainer-stack-deploy',
27-
'AlexPshkov/portainer-stack-deploy',
28-
// 'ManicMade/portainer-git-stack-redeploy-action',
29-
// 'fe5dds9/portainer-deploy-action',
30-
'SimonPrinz/portainer-deploy-action',
31-
'KevinLamSeck/gh-action-portainer-stack-deploy',
32-
'inova-notas/portainer-stack-deploy',
33-
'Morgul/portainer-stack-deploy',
34-
'mantichor/portainer-action',
8+
'cssnr/portainer-stack-deploy-action',
9+
'carlrygart/portainer-stack-deploy',
10+
'kgierke/portainer-stack-deployment',
11+
'nvti/portainer-stack-deploy',
12+
'LGinC/portainer-stack-deploy',
13+
'BramKelchtermans/portainer-deploy-action',
14+
'newarifrh/portainer-service-webhook',
15+
'wirgen/portainer-stack-redeploy-action',
16+
'bots-house/portainer-deploy-stack-action',
17+
'luminos-company/portami',
18+
'Hugollemos/deploy',
19+
'rrennoir/portainer-stack',
20+
'sdjnmxd/portainer-stack-deploy',
21+
'Filaind/portainer-stack-deploy',
22+
'robin-moser/portainer-stack-deploy',
23+
'spawnlab-dev/stack-deploy-action',
24+
'nevcodia/portainer-stack-deployment',
25+
// 'scod-br/portainer-stack-deploy',
26+
'dann41/portainer-stack-deploy',
27+
'AlexPshkov/portainer-stack-deploy',
28+
// 'ManicMade/portainer-git-stack-redeploy-action',
29+
// 'fe5dds9/portainer-deploy-action',
30+
'SimonPrinz/portainer-deploy-action',
31+
'KevinLamSeck/gh-action-portainer-stack-deploy',
32+
'inova-notas/portainer-stack-deploy',
33+
'Morgul/portainer-stack-deploy',
34+
'mantichor/portainer-action',
3535
]

0 commit comments

Comments
 (0)