-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: use latest generator rc release in the action (#8)
- Loading branch information
Showing
8 changed files
with
74,015 additions
and
59,026 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,9 @@ This action generates whatever you want using your AsyncAPI document. It uses [A | |
|
||
### `template` | ||
|
||
Template for the generator. Official templates are listed here https://github.com/search?q=topic%3Aasyncapi+topic%3Agenerator+topic%3Atemplate. You can pass template as npm package, url to git repository, link to tar file or local template. | ||
Template for the generator. Official templates are listed here https://github.com/asyncapi/generator#list-of-official-generator-templates. You can pass template as npm package, url to git repository, link to tar file or local template. | ||
|
||
**Default** points to `@asyncapi/markdown-template@0.3.0` template. | ||
**Default** points to `@asyncapi/markdown-template@0.10.0` template. | ||
|
||
> We recommend to always specify the version of the template to not encounter any issues with the action in case of release of the template that is not compatible with given version of the generator. | ||
|
@@ -28,55 +28,36 @@ Directory where to put the generated files. | |
|
||
**Default** points to `output` directory in the working directory. | ||
|
||
## Outputs | ||
|
||
### `files` | ||
|
||
List of generated files. | ||
|
||
## Example usage | ||
|
||
### Basic | ||
|
||
In case all defaults are fine for you, just add such step: | ||
|
||
``` | ||
```yaml | ||
- name: Generating Markdown from my AsyncAPI document | ||
uses: asyncapi/github-action-for-generator@v0.2.0 | ||
uses: asyncapi/github-action-for-generator@v1 | ||
``` | ||
### Using all possible inputs | ||
In case you do not want to use defaults, you for example want to use different template: | ||
``` | ||
```yaml | ||
- name: Generating HTML from my AsyncAPI document | ||
uses: asyncapi/github-action-for-generator@v0.2.0 | ||
uses: asyncapi/github-action-for-generator@v1 | ||
with: | ||
template: '@asyncapi/html-template@0.3.0' #In case of template from npm, because of @ it must be in quotes | ||
template: '@asyncapi/html-template@0.15.4' #In case of template from npm, because of @ it must be in quotes | ||
filepath: docs/api/my-asyncapi.yml | ||
parameters: baseHref=/test-experiment/ sidebarOrganization=byTags #space separated list of key/values | ||
output: generated-html | ||
``` | ||
### Accessing output of generation step | ||
|
||
In case you want to have more steps in your workflow after generation and you need to know what files were exactly generated, you can access this information as shown below: | ||
|
||
``` | ||
- name: Generating Markdown from my AsyncAPI document | ||
id: generation | ||
uses: asyncapi/[email protected] | ||
- name: Another step where I want to know what files were generated so I can pass it to another step and process them forward if needed | ||
run: echo '${{steps.generation.outputs.files}}' | ||
``` | ||
|
||
### Example workflow with publishing generated HTML to GitHub Pages | ||
In case you want to validate your asyncapi file first, and also send generated HTML to GitHub Pages this is how full workflow could look like: | ||
``` | ||
```yaml | ||
name: AsyncAPI documents processing | ||
|
||
on: | ||
|
@@ -93,15 +74,15 @@ jobs: | |
|
||
#Using another action for AsyncAPI for validation | ||
- name: Validating AsyncAPI document | ||
uses: WaleedAshraf/asyncapi-github-action@v0.0.3 | ||
uses: WaleedAshraf/asyncapi-github-action@v1 | ||
with: | ||
filepath: docs/api/my-asyncapi.yml | ||
|
||
#In case you do not want to use defaults, you for example want to use different template | ||
- name: Generating HTML from my AsyncAPI document | ||
uses: asyncapi/github-action-for-generator@v0.2.0 | ||
uses: asyncapi/github-action-for-generator@v1 | ||
with: | ||
template: '@asyncapi/html-template@0.3.0' #In case of template from npm, because of @ it must be in quotes | ||
template: '@asyncapi/html-template@0.9.0' #In case of template from npm, because of @ it must be in quotes | ||
filepath: docs/api/my-asyncapi.yml | ||
parameters: baseHref=/test-experiment/ sidebarOrganization=byTags #space separated list of key/values | ||
output: generated-html | ||
|
@@ -114,3 +95,7 @@ jobs: | |
BRANCH: gh-pages | ||
FOLDER: generated-html | ||
``` | ||
## Troubleshooting | ||
You can enable more log information in GitHub Action by adding `ACTIONS_STEP_DEBUG` secret to repository where you want to use this action. Set the value of this secret to `true` and you''ll notice more debug logs from this action. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.