Skip to content

Commit

Permalink
versionable docs
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Leszczynski <[email protected]>
  • Loading branch information
pawel-big-lebowski committed Aug 30, 2024
1 parent 0bcdf5f commit f30ede7
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 7 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/website-new-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build & Deploy spec to Github Pages

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
branches:
#- docs/versionable-docs # testing phase only

permissions:
id-token: write

jobs:
site-deploy:
name: Build and Publish To openlineage-site repo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: 'source'
fetch-depth: 0
fetch-tags: true
- uses: actions/checkout@v4
with:
repository: 'pawel-big-lebowski/openlineage-site'
path: 'target'
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
cache-dependency-path: source/website/package-lock.json
- name: Install dependencies
run: |
cd target
yarn install --frozen-lockfile
- name: Generate new version
run: |
cd source
LATEST_VERSION=$(git tag --sort=taggerdate | tail -1)
echo latest version is $LATEST_VERSION
echo "LATEST_VERSION=${LATEST_VERSION}" >> "$GITHUB_ENV"
cd ../target
yarn run docusaurus docs:version $LATEST_VERSION
- name: Push target repo
run: |
cd target
git config user.name "GitHub Action Website Snapshot"
git config user.email "<>"
git add .
if ! git diff-index --quiet HEAD; then
git commit -m "Generating new version $LATEST_VERSION"
git push
fi
7 changes: 4 additions & 3 deletions .github/workflows/website-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- docs-deploy # testing phase only
- docs/versionable-docs

permissions:
id-token: write
Expand Down Expand Up @@ -83,9 +83,10 @@ jobs:
popd
- name: Push target repo
run: |
rm -r target/*
cp -r source/website/* target
cd target
# remove all files and directories except those starting with version
find . ! -name 'version*' -exec rm -rf {} \;
cp -r ../source/website/* ./
git config user.name "GitHub Action Website Snapshot"
git config user.email "<>"
git add .
Expand Down
4 changes: 2 additions & 2 deletions website/docs/integrations/flink.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ The following parameters can be specified:

## Transports

import Transports from '../client/java/partials/java_transport.md';
import Transports from '@site/docs/client/java/partials/java_transport.md';

<Transports/>

## Circuit Breakers

import CircuitBreakers from '../client/java/partials/java_circuit_breaker.md';
import CircuitBreakers from '@site/docs/client/java/partials/java_circuit_breaker.md';

<CircuitBreakers/>

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ sidebar_position: 3
title: Circuit Breaker
---

import CircuitBreakers from '../../../client/java/partials/java_circuit_breaker.md';
import CircuitBreakers from '@site/docs/client/java/partials/java_circuit_breaker.md';

<CircuitBreakers/>
2 changes: 1 addition & 1 deletion website/docs/integrations/spark/configuration/transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ sidebar_position: 2
title: Transport
---

import Transports from '../../../client/java/partials/java_transport.md';
import Transports from '@site/docs/client/java/partials/java_transport.md';

<Transports/>
25 changes: 25 additions & 0 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -655,3 +655,28 @@ dl.py dl.field-list dt ul li p, dl.py dl.field-list dd ul li p {
margin: 0;
padding: 0;
}

/*
* Styling Sidebar's Version dropdown
*/
nav .dropdown--hoverable {
display: none;
}

aside div div:has(nav.menu) {
padding-top: 0 !important;
}
aside .custom-sidebarVersion {
margin-top: var(--ifm-navbar-height);
padding: 0.5rem 0 0 0.5rem;
}

aside .custom-sidebarVersion p {
margin-bottom: 0;
font-size: var(--fbc-font-size: 13px;);
padding: var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal);
}

aside .navbar__item {
padding: 0;
}
15 changes: 15 additions & 0 deletions website/src/theme/DocSidebar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import DocSidebar from '@theme-original/DocSidebar';
import DocsVersionDropdownNavbarItem from '@theme-original/NavbarItem/DocsVersionDropdownNavbarItem';

export default function DocSidebarWrapper(props) {
return (
<>
<div className="custom-sidebarVersion">
<p><u><b>Version:</b></u> <DocsVersionDropdownNavbarItem dropdownItemsBefore={[]} dropdownItemsAfter={[]} /></p>
</div>
<hr />
<DocSidebar {...props} />
</>
);
}

0 comments on commit f30ede7

Please sign in to comment.