mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 06:10:19 +00:00
3e6b771850
Signed-off-by: dusan <borovcanindusan1@gmail.com>
46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
# Copyright (c) Abstract Machines
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
name: Deploy GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
swagger-ui:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Build Swagger UI
|
|
run: |
|
|
# Create output directory
|
|
mkdir -p swagger-ui
|
|
|
|
# Copy OpenAPI YAML files and schemas directory
|
|
cp apidocs/openapi/*.yaml swagger-ui/
|
|
cp -r apidocs/openapi/schemas swagger-ui/
|
|
|
|
# Get list of YAML files
|
|
cd apidocs/openapi
|
|
YAML_FILES=$(ls *.yaml | jq -R -s -c 'split("\n")[:-1]')
|
|
cd ../..
|
|
|
|
# Generate index.html from template
|
|
sed "s|APIS_PLACEHOLDER|$YAML_FILES|g" .github/swagger-ui-template.html > swagger-ui/index.html
|
|
|
|
echo "Generated Swagger UI with APIs: $YAML_FILES"
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./swagger-ui
|
|
cname: docs.api.supermq.absmach.eu
|