diff --git a/src/_help/continuous-integration/github-actions.md b/src/_help/continuous-integration/github-actions.md index b6cfbb0f..c9eb7e97 100644 --- a/src/_help/continuous-integration/github-actions.md +++ b/src/_help/continuous-integration/github-actions.md @@ -218,6 +218,36 @@ jobs: > Make sure you adapt the name of the branch your deployment will target, _aka_ your destination branch if relevant (`main` in the example above), replace `` with your Bump.sh hub slug or id and point `file:` to your local API definition file folder (`docs/`). {: .warning} +Please note, by default, only files named `{slug}-api.[format]` are deployed. Where `{slug}` is a name for your API and `[format]` is either `yaml` or `json`. Adjust to your file naming convention using the `filename_pattern:` input. + +The pattern _can_ include `*` wildcard special character, but **must** include the `{slug}` filter to extract your documentation’s slug from the filename. The pattern can also have any other optional fixed characters. + +Here’s a practical example. Let’s assume that you have the following files in your `path/to/apis/` directory: + +``` +path/to/apis +└─ private-api-users-service.json +└─ partner-api-payments-service.yml +└─ public-api-contracts-service.yml +└─ data.json +└─ README.md +``` + +In order to deploy the 3 services API definition files from this folder (`private-api-users-service.json`, `partner-api-payments-service.yml` and `public-api-contracts-service.yml`), you can use the action like this: + +``` +[...] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Deploy API documentation + uses: bump-sh/github-action@v1 + with: + hub: + token: ${{secrets.BUMP_TOKEN}} + file: docs/ + filename_pattern: '*-api-{slug}-service' +``` ## Inputs