2023-04-10 06:26:52 +02:00

29 lines
1.0 KiB
Markdown

# Static API
Proof of concept repository to host a static API using GitHub workflows.
## How it works
On CI trigger static files are generated and commited to the `gh-pages` branch.
The static files are generated by the configuration provided in a `config.json` file in the root.
The API configuration consists out of an array of objects. Each object is responsible for an API. Based on the provided pair with the key `type` in these objects a method in `generator.py` is selected to generate the API. The objects are passed to the corresponding method to consume additional key-value pairs.
The following API configuration generates the `contributor` and `release` API for selected repositories:
```json
{
"api": [
{
"type": "release+contributor",
"repositories": ["user/repo"]
}
]
}
```
All static files are generated in the output path specified in the configuration.
## Setup
A repository variable `CONFIG` is expected by CD with the configuration (string escaped) which will be used by CD to generate the static files.