Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger-UI for public API #345

Merged
merged 13 commits into from
Jun 14, 2024
42 changes: 42 additions & 0 deletions .github/workflows/swagger_build-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Push Swagger-UI to R2 mainnet-api-docs.spacemesh.network

on:
push:
branches:
- master
paths:
- 'release/openapi/swagger/src/**'

jobs:
build-deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Use Node.js v20.14.0
uses: actions/setup-node@v3
with:
node-version: '20.14.0'

- name: npm install
run: npm install
working-directory: release/openapi/swagger

- name: npm build
run: npm run build
working-directory: release/openapi/swagger

- uses: actions/upload-artifact@v3
with:
name: swagger-ui-build
path: release/openapi/swagger/dist

- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.CLOUDFLARE_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }}
SOURCE_DIR: release/openapi/swagger/dist
DEST_DIR: ''
AWS_S3_ENDPOINT: https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.idea
bin/
release/openapi/swagger/node_modules
release/openapi/swagger/dist
10 changes: 10 additions & 0 deletions release/openapi/swagger/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Spacemesh Public API Documentation</title>
</head>
<body>
<div id="swagger"></div>
</body>
</html>
Loading
Loading