Skip to content

Commit

Permalink
docs: add multiversioned documentation (#344)
Browse files Browse the repository at this point in the history
Documentation is now published on the `gh-pages` branch.

The branch will have a folder `docs` containing the following structure:
- `./docs` the copy from the `main` docs, but only used for the `index.html` page to do the multi-version routing.
- `./docs/main` the copy from the `main` branch docs folder
- `./docs/beta` the copy from the `beta` branch docs folder

Closes #332
  • Loading branch information
acouvreur authored Jul 3, 2024
1 parent c1d578d commit 7ebfdd5
Show file tree
Hide file tree
Showing 16 changed files with 128 additions and 59 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Github Pages
on:
push:
branches:
- main
- beta
paths:
- '.github/workflows/pages.yml'
- 'docs/**'

env:
# Publish the main documentation in 'docs/main' folder, and the beta in 'docs/beta'
# Routing and version selection is handled in the main documentation.
DESTINATION_DIR: ${{ github.ref == 'refs/heads/main' && 'docs/main' || 'docs/beta' }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Deploy index.html
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
destination_dir: docs
# Subfolders docs/main and docs/beta will contain the actual versioned documentation.
# This is just to have the rooting properly done at the root.
keep_files: true

- name: Deploy versioned documentation
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
destination_dir: ${{ env.DESTINATION_DIR }}
keep_files: false
4 changes: 1 addition & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
![Latest Build](https://img.shields.io/github/actions/workflow/status/acouvreur/sablier/build.yml?style=flat-square&branch=main)![Go Report](https://goreportcard.com/badge/github.com/acouvreur/sablier?style=flat-square) ![Go Version](https://img.shields.io/github/go-mod/go-version/acouvreur/sablier?style=flat-square) ![Latest Release](https://img.shields.io/github/release/acouvreur/sablier/all.svg?style=flat-square)

# Sablier - Scale to Zero

Sablier is a **free** and **open-source** software that can scale your workloads on demand.

![Demo](assets/img/demo.gif)

Your workloads can be a docker container, a kubernetes deployment and more (see [providers](/providers/overview) for the full list).
Your workloads can be a docker container, a kubernetes deployment and more (see [providers](providers/overview) for the full list).


Sablier is an API that start containers for a given duration.
Expand Down
14 changes: 7 additions & 7 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@

This Getting Started will get you through what you need to understand how to use Sablier as a scale to zero middleware with a reverse proxy.

![integration](assets/img/integration.png)
![integration](/assets/img/integration.png)

## Identify your provider

The first thing you need to do is to identify your [Provider](/providers/overview).
The first thing you need to do is to identify your [Provider](providers/overview).

?> A Provider is how Sablier can interact with your instances and scale them up and down to zero.

You can check the available providers [here](/providers/overview?id=available-providers).
You can check the available providers [here](providers/overview?id=available-providers).

## Identify your reverse proxy

Once you've identified you're [Provider](/providers/overview), you'll want to identify your [Reverse Proxy](/plugins/overview).
Once you've identified you're [Provider](providers/overview), you'll want to identify your [Reverse Proxy](plugins/overview).

?> Because Sablier is designed as an API that can be used on its own, reverse proxy integrations acts as a client of that API.

You can check the available reverse proxy plugins [here](/plugins/overview?id=available-reverse-proxies)
You can check the available reverse proxy plugins [here](plugins/overview?id=available-reverse-proxies)

## Connect it all together

- Let's say we're using the [Docker Provider](/providers/docker).
- Let's say we're using the [Caddy Reverse Proxy Plugin](/plugins/caddy).
- Let's say we're using the [Docker Provider](providers/docker).
- Let's say we're using the [Caddy Reverse Proxy Plugin](plugins/caddy).

### 1. Initial setup with Caddy

Expand Down
41 changes: 35 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css">
<link rel="stylesheet" href="assets/style.css">
<link rel="icon" type="image/x-icon" href="assets/img/favicon.ico">
<style>
:root {
Expand All @@ -18,42 +19,70 @@
<body>
<div id="app"></div>
<script>
console.log("Loading docs/index.html")
window.$docsify = {
name: 'sablier',
name: '<a id="home-link" class="app-name-link">Sablier</a><div>' +
'<select id="version-selector" class="sidebar-version-select" name="version">' +
'<option value="main">main</value>' +
'<option value="beta">beta</value>' +
'</select></div>',
// disable automatic linking to avoid navigating when clicking on select
nameLink: false,
repo: 'https://github.com/acouvreur/sablier',
notFoundPage: true,
loadSidebar: true,
relativePath: true,
alias: {
'/.*/_sidebar.md': '/_sidebar.md'
// Uncomment lines below for local development.
// '/main/': 'README.md',
// '/main/(.*)': '$1',
'/beta/.*/_sidebar.md': '/beta/_sidebar.md',
'/main/.*/_sidebar.md': '/main/_sidebar.md',
},
auto2top : true,
maxLevel : 3,
subMaxLevel: 3,
namespaces: [
{
id: "version",
values: ["main", "beta"],
default: "main",
optional: true,
selector: "#version-selector",
}
],
tabs: {
persist : true, // default
sync : true, // default
theme : 'classic', // default
tabComments: true, // default
tabHeadings: true // default
},
search: {
paths: 'auto',
hideOtherSidebarContent: true,
depth: 3,
pathNamespaces: ['/main', '/beta']
}
}
</script>
<!-- Docsify v4 -->
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/js/docsify-themeable.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify-tabs@1"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-themeable@0/dist/js/docsify-themeable.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-tabs@1"></script>
<script src="//unpkg.com/prismjs/components/prism-go.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-yaml.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-docker.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>

<!-- plugins -->
<script src="//unpkg.com/[email protected]/dist/docsify-namespaced.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script src="https://unpkg.com/docsify-copy-code@2"></script>
<script src="//unpkg.com/docsify-copy-code@2"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-edit-on-github"></script>
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/zoom-image.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify@4/lib/plugins/zoom-image.min.js"></script>
<script src="//unpkg.com/docsify-plantuml/dist/docsify-plantuml.min.js"></script>
</body>
</html>
10 changes: 5 additions & 5 deletions docs/plugins/apacheapisix.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ The Apache APISIX Plugin is a WASM Plugin written with the Proxy Wasm SDK.

## Provider compatibility grid

| Provider | Dynamic | Blocking |
|-----------------------------------------|:-------:|:--------:|
| [Docker](/providers/docker) |||
| [Docker Swarm](/providers/docker_swarm) |||
| [Kubernetes](/providers/kubernetes) |||
| Provider | Dynamic | Blocking |
|----------------------------------------|:-------:|:--------:|
| [Docker](../providers/docker) |||
| [Docker Swarm](../providers/docker_swarm) |||
| [Kubernetes](../providers/kubernetes) |||

## Install the plugin to Apache APISIX

Expand Down
6 changes: 3 additions & 3 deletions docs/plugins/caddy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Caddy Sablier Plugin.

| Provider | Dynamic | Blocking |
| --------------------------------------- | :-----: | :------: |
| [Docker](/providers/docker) |||
| [Docker Swarm](/providers/docker_swarm) |||
| [Kubernetes](/providers/kubernetes) |||
| [Docker](../providers/docker) |||
| [Docker Swarm](../providers/docker_swarm) |||
| [Kubernetes](../providers/kubernetes) |||

## Install the plugin to Caddy

Expand Down
6 changes: 3 additions & 3 deletions docs/plugins/envoy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ The Envoy Plugin is a WASM Plugin written with the Proxy Wasm SDK.

| Provider | Dynamic | Blocking |
|-----------------------------------------|:-------:|:--------:|
| [Docker](/providers/docker) |||
| [Docker Swarm](/providers/docker_swarm) |||
| [Kubernetes](/providers/kubernetes) |||
| [Docker](../providers/docker) |||
| [Docker Swarm](../providers/docker_swarm) |||
| [Kubernetes](../providers/kubernetes) |||

## Configuration

Expand Down
6 changes: 3 additions & 3 deletions docs/plugins/istio.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ The Istio Plugin is a WASM Plugin written with the Proxy Wasm SDK.

| Provider | Dynamic | Blocking |
|-----------------------------------------|:-------:|:--------:|
| [Docker](/providers/docker) |||
| [Docker Swarm](/providers/docker_swarm) |||
| [Kubernetes](/providers/kubernetes) |||
| [Docker](../providers/docker) |||
| [Docker Swarm](../providers/docker_swarm) |||
| [Kubernetes](../providers/kubernetes) |||

## Configuration

Expand Down
6 changes: 3 additions & 3 deletions docs/plugins/nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ The Nginx Sablier Plugin is a javascript file that runs through the NJS Module.

| Provider | Dynamic | Blocking |
| --------------------------------------- | :-----: | :------: |
| [Docker](/providers/docker) |||
| [Docker Swarm](/providers/docker_swarm) |||
| [Kubernetes](/providers/kubernetes) |||
| [Docker](../providers/docker) |||
| [Docker Swarm](../providers/docker_swarm) |||
| [Kubernetes](../providers/kubernetes) |||


## Install the plugin to NGINX
Expand Down
6 changes: 3 additions & 3 deletions docs/plugins/nginx_proxywasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ The Nginx Plugin is a WASM Plugin written with the Proxy Wasm SDK.

| Provider | Dynamic | Blocking |
|-----------------------------------------|:-------:|:--------:|
| [Docker](/providers/docker) |||
| [Docker Swarm](/providers/docker_swarm) |||
| [Kubernetes](/providers/kubernetes) |||
| [Docker](../providers/docker) |||
| [Docker Swarm](../providers/docker_swarm) |||
| [Kubernetes](../providers/kubernetes) |||

# Install ngx_wasm_module

Expand Down
16 changes: 8 additions & 8 deletions docs/plugins/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ It leverages the API calls to plugin integration to catch in-flight requests to

| Reverse Proxy | Docker | Docker Swarm mode | Kubernetes |
|-------------------------------------------------|:------:|:-----------------:|:----------:|
| [Apache APISIX](/plugins/apacheapisix) ||||
| [Caddy](/plugins/caddy) ||||
| [Envoy](/plugins/envoy) ||||
| [Istio](plugins/istio) ||| ⚠️ |
| [Nginx (NJS Module)](/plugins/nginx_njs) ||||
| [Nginx (WASM Module)](/plugins/nginx_proxywasm) ||||
| [Traefik](/plugins/traefik) ||||
| [ProxyWasm](/plugins/proxywasm) ||||
| [Apache APISIX](apacheapisix) ||||
| [Caddy](caddy) ||||
| [Envoy](envoy) ||||
| [Istio](istio) ||| ⚠️ |
| [Nginx (NJS Module)](nginx_njs) ||||
| [Nginx (WASM Module)](nginx_proxywasm) ||||
| [Traefik](traefik) ||||
| [ProxyWasm](proxywasm) ||||

> **Fully compatible**
>
Expand Down
6 changes: 3 additions & 3 deletions docs/plugins/traefik.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ The [Traefik Sablier Plugin](https://plugins.traefik.io/plugins/633b4658a4caa9dd

| Provider | Dynamic | Blocking |
| --------------------------------------- | :-----: | :-----------------------------------------------------: |
| [Docker](/providers/docker) |||
| [Docker Swarm](/providers/docker_swarm) |||
| [Kubernetes](/providers/kubernetes) |||
| [Docker](../providers/docker) |||
| [Docker Swarm](../providers/docker_swarm) |||
| [Kubernetes](../providers/kubernetes) |||

## Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion docs/providers/docker_swarm.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Docker Swarm provider communicates with the `docker.sock` socket to scale se

## Use the Docker Swarm provider

In order to use the docker provider you can configure the [provider.name](TODO) property.
In order to use the docker swarm provider you can configure the [provider.name](TODO) property.

<!-- tabs:start -->

Expand Down
2 changes: 1 addition & 1 deletion docs/providers/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Sablier assumes that it is deployed within the Kubernetes cluster to use the Kub

## Use the Kubernetes provider

In order to use the docker provider you can configure the [provider.name](TODO) property.
In order to use the kubernetes provider you can configure the [provider.name](TODO) property.

<!-- tabs:start -->

Expand Down
16 changes: 8 additions & 8 deletions docs/providers/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ A Provider typically have the following capabilities:

## Available providers

| Provider | Name | Details |
|-----------------------------------------|---------------------------|------------------------------------------------------------------|
| [Docker](/providers/docker) | `docker` | Stop and start **containers** on demand |
| [Docker Swarm](/providers/docker_swarm) | `docker_swarm` or `swarm` | Scale down to zero and up **services** on demand |
| [Kubernetes](/providers/kubernetes) | `kubernetes` | Scale down and up **deployments** and **statefulsets** on demand |
| [Podman](/providers/podman) | `podman` | [See #70](https://github.com/acouvreur/sablier/issues/70) |
| [ECS](/providers/ec2) | `ecs` | [See #116](https://github.com/acouvreur/sablier/issues/116) |
| [Systemd](/providers/systemd) | `systemd` | [See #148](https://github.com/acouvreur/sablier/issues/148) |
| Provider | Name | Details |
|------------------------------------------------------------|---------------------------|------------------------------------------------------------------|
| [Docker](docker) | `docker` | Stop and start **containers** on demand |
| [Docker Swarm](docker_swarm) | `docker_swarm` or `swarm` | Scale down to zero and up **services** on demand |
| [Kubernetes](kubernetes) | `kubernetes` | Scale down and up **deployments** and **statefulsets** on demand |
| [Podman](https://github.com/acouvreur/sablier/issues/70) | `podman` | [See #70](https://github.com/acouvreur/sablier/issues/70) |
| [ECS](https://github.com/acouvreur/sablier/issues/116) | `ecs` | [See #116](https://github.com/acouvreur/sablier/issues/116) |
| [Systemd](https://github.com/acouvreur/sablier/issues/148) | `systemd` | [See #148](https://github.com/acouvreur/sablier/issues/148) |

*Your Provider is not on the list? [Open an issue to request the missing provider here!](https://github.com/acouvreur/sablier/issues/new?assignees=&labels=enhancement%2C+provider&projects=&template=instance-provider-request.md&title=Add+%60%5BPROVIDER%5D%60+provider)*

Expand Down
2 changes: 0 additions & 2 deletions docs/strategies.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Strategies

When configuring

## Dynamic Strategy

The **Dynamic Strategy** provides a waiting page for your session.
Expand Down

0 comments on commit 7ebfdd5

Please sign in to comment.