From 7ebfdd50ffab190a078dc86cd49256f4845e0187 Mon Sep 17 00:00:00 2001 From: Alexis Couvreur Date: Wed, 3 Jul 2024 14:56:59 -0400 Subject: [PATCH] docs: add multiversioned documentation (#344) 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 --- .github/workflows/pages.yml | 44 +++++++++++++++++++++++++++++++++ docs/README.md | 4 +-- docs/getting-started.md | 14 +++++------ docs/index.html | 41 +++++++++++++++++++++++++----- docs/plugins/apacheapisix.md | 10 ++++---- docs/plugins/caddy.md | 6 ++--- docs/plugins/envoy.md | 6 ++--- docs/plugins/istio.md | 6 ++--- docs/plugins/nginx.md | 6 ++--- docs/plugins/nginx_proxywasm.md | 6 ++--- docs/plugins/overview.md | 16 ++++++------ docs/plugins/traefik.md | 6 ++--- docs/providers/docker_swarm.md | 2 +- docs/providers/kubernetes.md | 2 +- docs/providers/overview.md | 16 ++++++------ docs/strategies.md | 2 -- 16 files changed, 128 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000..8950b30c --- /dev/null +++ b/.github/workflows/pages.yml @@ -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 \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 24aaf526..e72ad72d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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. diff --git a/docs/getting-started.md b/docs/getting-started.md index 3f597216..f9244e1e 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -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 diff --git a/docs/index.html b/docs/index.html index 6ad3ffe7..a165a88f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -7,6 +7,7 @@ +