-
Notifications
You must be signed in to change notification settings - Fork 147
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
Showing
459 changed files
with
44,829 additions
and
1 deletion.
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,135 @@ | ||
name: Docs | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
paths: | ||
- 'website/**' | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- 'website/**' | ||
|
||
jobs: | ||
update-doc-repo-files: | ||
runs-on: ubuntu-latest | ||
if: github.event_name != 'push' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Unshallow | ||
run: | | ||
git fetch --prune --unshallow | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
- name: Create GitOps binary | ||
run: | | ||
make all | ||
- name: Set up environment vars | ||
run: | | ||
echo "BRANCH=release-doc-updates-$$" >> $GITHUB_ENV | ||
echo "GITOPS_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | ||
- name: Update with new version | ||
env: | ||
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | ||
GA_KEY: "dummy" | ||
run: | | ||
bash tools/update-docs.sh ${PWD}/bin/gitops ${PWD}/website | ||
- name: Git diff | ||
run: | | ||
git diff | ||
- name: Delete version | ||
run: | | ||
version=$(cat -p website/versions.json|jq -r '. | last') | ||
rm -rf website/versioned_docs/version-$version | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@9825ae65b1cb54b543b938503728b432a0176d29 # v3 | ||
with: | ||
token: ${{ secrets.WEAVE_GITOPS_DOCS_WEAVEWORKS_DOCS_BOT_PAT }} | ||
committer: GitHub <noreply@github.com> | ||
author: weave-test-user <weave-test-user@example.com> | ||
signoff: true | ||
branch: ${{ env.BRANCH }} | ||
base: add-docs | ||
draft: true | ||
title: "Documentation updates for ${{ env.GITOPS_VERSION }}" | ||
body: "Update version references to ${{ env.GITOPS_VERSION }} and create new versioned documentation set." | ||
staging-release: | ||
if: github.event_name != 'push' | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: website | ||
steps: | ||
- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e | ||
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d | ||
with: | ||
node-version: "14.x" | ||
- name: Test Build | ||
env: | ||
GA_KEY: "dummy" | ||
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | ||
run: | | ||
if [ -e yarn.lock ]; then | ||
yarn install --frozen-lockfile | ||
elif [ -e package-lock.json ]; then | ||
npm ci | ||
else | ||
npm i | ||
fi | ||
npm run build | ||
- id: auth | ||
uses: google-github-actions/auth@v0.4.0 | ||
with: | ||
credentials_json: ${{ secrets.PROD_DOCS_GITOPS_UPLOAD }} | ||
- id: upload-file | ||
uses: google-github-actions/upload-cloud-storage@v0.4.0 | ||
with: | ||
path: website/build | ||
destination: staging.docs.gitops.weave.works | ||
parent: false | ||
prod-release: | ||
if: github.event_name != 'pull_request' | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: website | ||
steps: | ||
- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e | ||
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d | ||
with: | ||
node-version: "14.x" | ||
- uses: weaveworks/webfactory-ssh-agent@6b2f2c5354ff41f1edbbf7a17ea9b6178c89be9f | ||
with: | ||
ssh-private-key: ${{ secrets.WEAVE_GITOPS_DOCS_WEAVEWORKS_DOCS_BOT_DEPLOY_KEY }} | ||
- name: Release to GitHub Pages | ||
env: | ||
USE_SSH: true | ||
GIT_USER: git | ||
GA_KEY: ${{ secrets.GA_KEY }} | ||
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | ||
run: | | ||
git config --global user.email "corporate-it+weaveworks-docs-bot@weave.works" | ||
git config --global user.name "weaveworks-docs-bot" | ||
if [ -e yarn.lock ]; then | ||
yarn install --frozen-lockfile | ||
elif [ -e package-lock.json ]; then | ||
npm ci | ||
else | ||
npm i | ||
fi | ||
npm run build | ||
- id: auth | ||
uses: google-github-actions/auth@v0.4.0 | ||
with: | ||
credentials_json: ${{ secrets.PROD_DOCS_GITOPS_UPLOAD }} | ||
- id: upload-file | ||
uses: google-github-actions/upload-cloud-storage@v0.4.0 | ||
with: | ||
path: website/build | ||
destination: production.docs.gitops.weave.works | ||
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
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,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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,35 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. | ||
|
||
## Installation | ||
|
||
```console | ||
yarn install | ||
``` | ||
|
||
## Local Development | ||
|
||
Set a fake Algolia API key to pass validation errors: | ||
|
||
```shell | ||
export ALGOLIA_API_KEY=fakekey | ||
``` | ||
|
||
```console | ||
yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
## Build | ||
|
||
```console | ||
yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
## Deployment | ||
|
||
Deployment happens automatically (once the tests pass) upon merging to the default branch: see [.github/workflows/documentation.yml](.github/workflows/documentation.yml) for config. |
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,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
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,32 @@ | ||
import React from "react"; | ||
import Link from "@docusaurus/Link"; | ||
import useGlobalData from "@docusaurus/useGlobalData"; | ||
|
||
const containerStyle = { | ||
fontSize: 16, | ||
marginLeft: 4, | ||
fontVariant: "all-small-caps", | ||
}; | ||
|
||
// This determines the current version of the docs you're looking at | ||
// E.g. /docs/next or /docs/0.2.5 | ||
const getCurrentVersionPath = () => { | ||
const { "docusaurus-plugin-content-docs": data } = useGlobalData(); | ||
const currentVersion = data?.default?.versions?.find( | ||
(v) => v.name === "current" | ||
); | ||
// Fallback to /docs just in case. Not sure if this is async etc. | ||
return currentVersion?.path || "/docs"; | ||
}; | ||
|
||
export default function TierLabel({ tiers }) { | ||
return ( | ||
<Link | ||
to={`${getCurrentVersionPath()}/enterprise/intro`} | ||
title={`This feature is a available on ${tiers}`} | ||
style={containerStyle} | ||
> | ||
{tiers} | ||
</Link> | ||
); | ||
} |
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,8 @@ | ||
--- | ||
sidebar_position: 4 | ||
--- | ||
|
||
# Architecture | ||
|
||
Coming soon | ||
|
Oops, something went wrong.