Skip to content
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
28 changes: 18 additions & 10 deletions .github/workflows/swagger.yml → .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: API Swagger Docs
name: API Docs

on:
push:
branches:
- main
paths-ignore:
- "docs/swagger.yaml"
- "docs/api/swagger.yaml"
pull_request:
paths:
- "api/**/*"
Expand Down Expand Up @@ -35,13 +35,13 @@ jobs:
uses: actions/upload-artifact@v7
with:
name: swagger.yaml
path: docs/swagger.yaml
path: docs/api/swagger.yaml

- name: Check if there is a difference
uses: mathiasvr/command-output@v2.0.0
id: diff
with:
run: git diff --no-color docs/swagger.yaml
run: git diff --no-color docs/api/swagger.yaml

- name: Mark previous comment as outdated if no diff
if: ${{ github.event_name == 'pull_request' && steps.diff.outputs.stdout == '' }}
Expand All @@ -67,12 +67,12 @@ jobs:
run: |
git config user.name "github-actions"
git config user.email "github-actions@users.noreply.github.com"
git add docs/swagger.yaml
git add docs/api/swagger.yaml
git commit -m "ci: regenerate swagger.yaml after merge"
git push

deploy-pages:
name: Deploy Swagger UI to GitHub Pages
name: Deploy docs site and Swagger UI to GitHub Pages
needs: api-swagger
if: github.event_name == 'push'
runs-on: ubuntu-latest
Expand All @@ -91,21 +91,29 @@ jobs:
steps:
- uses: actions/checkout@v7

- name: Overwrite docs/swagger.yaml with the freshly generated spec
- name: Overwrite docs/api/swagger.yaml with the freshly generated spec
uses: actions/download-artifact@v4
with:
name: swagger.yaml
path: docs
path: docs/api

- name: Generate Swagger UI assets
run: ./scripts/generate-swagger-ui.sh

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Build docs site with Jekyll
run: bundle exec jekyll build --source docs --destination _site

- uses: actions/configure-pages@v6

- name: Upload docs/ (Swagger UI + spec)
- name: Upload built site
uses: actions/upload-pages-artifact@v3
with:
path: docs
path: _site

- name: Deploy to GitHub Pages
id: deployment
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@
*.env
!.env.example
!example.env
vegeta.conf
vegeta.conf

# Generated Swagger UI assets (produced by scripts/generate-swagger-ui.sh)
docs/api/index.html
docs/api/swagger-ui.css
docs/api/swagger-ui-bundle.js
docs/api/LICENSE.swagger-ui

# Jekyll build output
_site/
35 changes: 0 additions & 35 deletions Dockerfile

This file was deleted.

4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "https://rubygems.org"

gem "jekyll", "~> 4.3"
gem "just-the-docs"
173 changes: 173 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.9.0)
public_suffix (>= 2.0.2, < 8.0)
base64 (0.3.0)
bigdecimal (4.1.2)
colorator (1.1.0)
concurrent-ruby (1.3.8)
csv (3.3.6)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.17.4)
ffi (1.17.4-aarch64-linux-gnu)
ffi (1.17.4-aarch64-linux-musl)
ffi (1.17.4-arm-linux-gnu)
ffi (1.17.4-arm-linux-musl)
ffi (1.17.4-arm64-darwin)
ffi (1.17.4-x86-linux-gnu)
ffi (1.17.4-x86-linux-musl)
ffi (1.17.4-x86_64-darwin)
ffi (1.17.4-x86_64-linux-gnu)
ffi (1.17.4-x86_64-linux-musl)
forwardable-extended (2.6.0)
google-protobuf (4.36.0)
bigdecimal
rake (~> 13.3)
google-protobuf (4.36.0-aarch64-linux-gnu)
bigdecimal
rake (~> 13.3)
google-protobuf (4.36.0-aarch64-linux-musl)
bigdecimal
rake (~> 13.3)
google-protobuf (4.36.0-arm64-darwin)
bigdecimal
rake (~> 13.3)
google-protobuf (4.36.0-x86-linux-gnu)
bigdecimal
rake (~> 13.3)
google-protobuf (4.36.0-x86-linux-musl)
bigdecimal
rake (~> 13.3)
google-protobuf (4.36.0-x86_64-darwin)
bigdecimal
rake (~> 13.3)
google-protobuf (4.36.0-x86_64-linux-gnu)
bigdecimal
rake (~> 13.3)
google-protobuf (4.36.0-x86_64-linux-musl)
bigdecimal
rake (~> 13.3)
http_parser.rb (0.8.1)
i18n (1.15.2)
concurrent-ruby (~> 1.0)
jekyll (4.4.1)
addressable (~> 2.4)
base64 (~> 0.2)
colorator (~> 1.0)
csv (~> 3.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
json (~> 2.6)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.3, >= 0.3.6)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-include-cache (0.2.2)
jekyll (>= 3.7, < 5.0)
jekyll-sass-converter (3.1.0)
sass-embedded (~> 1.75)
jekyll-seo-tag (2.9.0)
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
json (2.21.2)
just-the-docs (0.12.0)
jekyll (>= 3.8.5)
jekyll-include-cache
jekyll-seo-tag (>= 2.0)
rake (>= 12.3.1)
kramdown (2.5.2)
rexml (>= 3.4.4)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.10.0)
logger
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.7.0)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (7.0.5)
rake (13.4.2)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.4.4)
rouge (4.7.0)
safe_yaml (1.0.5)
sass-embedded (1.103.1)
google-protobuf (~> 4.31)
rake (>= 13)
sass-embedded (1.103.1-aarch64-linux-android)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-aarch64-linux-gnu)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-aarch64-linux-musl)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-arm-linux-androideabi)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-arm-linux-gnueabihf)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-arm-linux-musleabihf)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-arm64-darwin)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-riscv64-linux-android)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-riscv64-linux-gnu)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-riscv64-linux-musl)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-x86_64-darwin)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-x86_64-linux-android)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-x86_64-linux-gnu)
google-protobuf (~> 4.31)
sass-embedded (1.103.1-x86_64-linux-musl)
google-protobuf (~> 4.31)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.6.0)
webrick (1.9.2)

PLATFORMS
aarch64-linux-android
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-androideabi
arm-linux-gnu
arm-linux-gnueabihf
arm-linux-musl
arm-linux-musleabihf
arm64-darwin
riscv64-linux-android
riscv64-linux-gnu
riscv64-linux-musl
ruby
x86-linux-gnu
x86-linux-musl
x86_64-darwin
x86_64-linux-android
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
jekyll (~> 4.3)
just-the-docs

BUNDLED WITH
2.5.23
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: demo api swagger-ui clean-demo clean-api
.PHONY: demo api swagger-ui docs clean-demo clean-api

demo: clean-demo
@echo "Building demo image..."
Expand Down Expand Up @@ -30,9 +30,19 @@ clean-api:

swagger-ui:
./scripts/generate-swagger.sh
@trap 'truncate -s 0 docs/swagger.yaml' EXIT; \
@trap 'git checkout HEAD -- docs/api/swagger.yaml' EXIT; \
docker run --rm \
-p 8081:8080 \
-e SWAGGER_JSON=/spec/swagger.yaml \
-v "$$PWD/docs:/spec:ro" \
docker.swagger.io/swaggerapi/swagger-ui
-v "$$PWD/docs/api:/spec:ro" \
docker.swagger.io/swaggerapi/swagger-ui

docs:
docker run --rm -it \
-p 4000:4000 \
-p 35729:35729 \
-v "$$PWD:/app" \
-v "jekyll-gems:/usr/local/bundle" \
-w /app \
ruby:3.3 \
bash -lc 'gem install bundler -v 2.5.23 --no-document && bundle install && bundle exec jekyll serve --source docs --livereload --host 0.0.0.0'
Loading
Loading