-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7159c1
commit 0075a55
Showing
2 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Deploy to Developer Portal PROD Bucket | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/workflows/deploy-to-developer-portal-prod.yml' | ||
- 'docusaurus/**' | ||
jobs: | ||
deploy: | ||
name: Deploy docs to Developer Portal Bucket | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
#mac: sed -i '' 's/title: Get started/title: Get started\nslug:\ \//g' ./docusaurus/docs/get-started/get-started.mdx | ||
#mac: grep -rl "](/docs/" docusaurus/docs | xargs sed -i '' 's/](\/docs\//](\//g' | ||
#linux: sed -i 's/title: Get started/title: Get started\nslug:\ \//g' ./docusaurus/docs/get-started/get-started.mdx | ||
#linux: grep -rl "](/docs/" docusaurus/docs | xargs sed -i 's/](\/docs\//](\//g' | ||
- name: Make docs the homepage of this subsite | ||
run: | | ||
rm -f ./docusaurus/website/src/pages/index.tsx | ||
sed -i 's/title: Get started/title: Get started\nslug:\ \//g' ./docusaurus/docs/get-started/get-started.mdx | ||
grep -rl "](/docs/" docusaurus/docs | xargs sed -i 's/](\/docs\//](\//g' | ||
- name: Build documentation website | ||
run: npm run docs:build -- --config docusaurus.config.devportal.prod.js | ||
|
||
- id: 'auth' | ||
uses: 'google-github-actions/auth@v1' | ||
with: | ||
credentials_json: ${{ secrets.GCP_SA_KEY }} | ||
- name: Deploy to Developer Portal Bucket | ||
uses: google-github-actions/upload-cloud-storage@v1 | ||
with: | ||
path: './docusaurus/website/build/' | ||
destination: 'grafana-developer-portal/plugin-tools' | ||
parent: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// @ts-check | ||
// Note: type annotations allow type checking and IDEs autocompletion | ||
|
||
const { | ||
generalConfig, | ||
plugins, | ||
presetsDocs, | ||
presetsTheme, | ||
themeConfigNavbar, | ||
themeConfigFooter, | ||
themeConfigPrism, | ||
themeConfigColorMode, | ||
} = require('./docusaurus.config.base'); | ||
|
||
|
||
// Replace docs link in footer so builds don't have broken links. | ||
const [docs, ...rest] = themeConfigFooter.links; | ||
const footerConfig = { | ||
...themeConfigFooter, | ||
links: [ | ||
{ | ||
title: 'Docs', | ||
items: [ | ||
{ | ||
label: 'Get Started', | ||
to: '/', | ||
}, | ||
], | ||
}, | ||
...rest, | ||
], | ||
}; | ||
|
||
/** @type {import('@docusaurus/types').Config} */ | ||
const config = { | ||
...generalConfig, | ||
url: 'https://grafana.com/', | ||
baseUrl: 'developers/plugin-tools/', | ||
|
||
plugins: plugins, | ||
|
||
presets: [ | ||
[ | ||
'classic', | ||
/** @type {import('@docusaurus/preset-classic').Options} */ | ||
({ | ||
docs: { | ||
...presetsDocs, | ||
routeBasePath: '/', | ||
}, | ||
theme: presetsTheme, | ||
blog: false, | ||
}), | ||
], | ||
], | ||
|
||
themeConfig: | ||
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */ | ||
({ | ||
navbar: themeConfigNavbar, | ||
footer: footerConfig, | ||
prism: themeConfigPrism, | ||
colorMode: themeConfigColorMode, | ||
}), | ||
}; | ||
|
||
module.exports = config; |