Skip to content
Open
42 changes: 42 additions & 0 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
push:
paths:
- 'openapi/yaml/*.yaml'

jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout vast-cli
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4

- name: Run combine script
run: python openapi/combine_api_yamls.py

- name: Convert YAML to JSON
run: |
# example: using yq
pip install yq
yq . openapi/yaml/combined_api.yaml > openapi.json

- name: Checkout docs repo
uses: actions/checkout@v3
with:
repository: vast-ai/docs
token: ${{ secrets.UPDATE_API_DOCS_TOKEN }}
path: docs-repo

- name: Copy openapi.json to docs
run: cp openapi.json docs-repo/api-reference/openapi.json

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.UPDATE_API_DOCS_TOKEN }}
path: docs-repo
commit-message: 'Update openapi.json from vast-cli'
title: 'Automated update of openapi.json'
body: 'This PR updates the openapi.json based on latest changes in vast-cli.'
2 changes: 1 addition & 1 deletion openapi/yaml/change_bid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ paths:
/api/v0/instances/bid_price/{id}/:
put:
summary: change bid
description: 'Change the current bid price of an instance to a specified price.
description: 'Change current bid price of an instance to a specified price.

CLI Usage: vastai change bid id [--price PRICE]'
security:
Expand Down
2 changes: 1 addition & 1 deletion openapi/yaml/cloud_copy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ paths:
/api/v0/commands/rclone/:
post:
summary: cloud copy
description: 'Starts a cloud copy operation by sending a command to the remote
description: 'Starts cloud copy operation by sending a command to the remote
server. The operation can transfer data between an instance and a cloud service.

'
Expand Down
8 changes: 3 additions & 5 deletions openapi/yaml/create_endpoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ paths:
/api/v0/endptjobs/:
post:
summary: create endpoint
description: 'This endpoint creates a new job processing endpoint with specified
description: |
This endpoint creates a new job processing endpoint with specified
parameters.


CLI Usage: vast-ai create endpoint

'
CLI Usage: `vast-ai create endpoint`
security:
- BearerAuth: []
requestBody:
Expand Down
2 changes: 1 addition & 1 deletion openapi/yaml/start_instances.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.0
info:
title: Vast.ai Start Instances API
description: API endpoint to start a list of instances on Vast.ai.
description: API endpoint to start a list of instances on Vast.ai
version: 1.0.0
servers:
- url: https://console.vast.ai
Expand Down
Loading