Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding prod deployment target #30

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-developer-portal-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
sed -i '1s/^/---\nslug: \/\n---\n/' ./docs/contract/contract.md

- name: Build documentation website
run: yarn docs:build:devportal
run: yarn docs:build:devportal:dev

- id: 'auth'
uses: 'google-github-actions/auth@v1'
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/deploy-to-developer-portal-prod.yml
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/**"
- "docs/**"
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: 'yarn'

- name: Install dependencies
run: yarn install --immutable --prefer-offline

#mac: sed -i '' '1s/^/---\nslug: \/\n---\n/' ./docs/contract/contract.md
#linux: sed -i '1s/^/---\nslug: \/\n---\n/' ./docs/contract/contract.md
- name: Make docs the homepage of this subsite
run: |
rm -f ./docusaurus/website/src/pages/index.tsx
sed -i '1s/^/---\nslug: \/\n---\n/' ./docs/contract/contract.md

- name: Build documentation website
run: yarn docs:build:devportal:prod

- 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/dataplane'
parent: false
135 changes: 135 additions & 0 deletions docusaurus/website/docusaurus.config.devportal.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
// const remark = require("remark");
// const stripHTML = require("remark-strip-html");

/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Grafana Data Plane",
tagline: "A contract of data types as the source of truth",
url: "https://grafana.com/",
baseUrl: "developers/dataplane/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.png",
organizationName: "grafana",
projectName: "dataplane",
i18n: {
defaultLocale: "en",
locales: ["en"],
},
plugins: [],
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: "/",
path: "../../docs/contract",
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
"https://github.com/grafana/dataplane/edit/main/docusaurus/website",
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
blog: false,
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: "Grafana Data Plane",
logo: {
alt: "Grafana Logo",
src: "img/logo.svg",
},
items: [
{
type: "doc",
docId: "contract",
position: "right",
label: "Contract",
},
{
href: "https://www.github.com/grafana/dataplane",
label: "GitHub",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Contract",
to: "/",
},
],
},
{
title: "Tools & Examples",
items: [
{
label: "Mock Data Source Plugin",
href: "https://grafana.com/plugins/grafana-mock-datasource",
},
{
label: "Example Data Frames (JSON)",
href: "https://github.com/grafana/dataplane/tree/main/examples/data",
},
{
label: "Go Testing/Example Library",
href: "https://pkg.go.dev/github.com/grafana/dataplane/examples",
},
{
label: "Go Dataplane Library",
href: "https://pkg.go.dev/github.com/grafana/dataplane/sdata",
},
],
},
{
title: "Other Resources",
items: [
{
label: "Go Plugin Data Package",
href: "hhttps://pkg.go.dev/github.com/grafana/grafana-plugin-sdk-go/data",
}
],
},
{
title: "Community",
items: [
{
label: "GitHub",
href: "https://www.github.com/grafana/dataplane",
},
{
label: "Github Issues",
href: "https://www.github.com/grafana/dataplane/issues",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Grafana Labs. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};

module.exports = config;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"scripts": {
"spellcheck": "cspell -c cspell.config.json \"**/*.{ts,tsx,js,go,md,mdx,yml,yaml,json,scss,css}\"",
"docs:build": "turbo docs:build",
"docs:build:devportal": "turbo docs:build -- --config=docusaurus.config.devportal.js",
"docs:build:devportal:dev": "turbo docs:build -- --config=docusaurus.config.devportal.js",
"docs:build:devportal:prod": "turbo docs:build -- --config=docusaurus.config.devportal.prod.js",
"test:backend": "turbo test:backend",
"test": "turbo test:backend"
},
Expand Down