Build and publish single-file Onfido OpenAPI specs #25
Workflow file for this run
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
name: generate-single-openapi-spec | |
run-name: Build and publish single-file Onfido OpenAPI specs | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build-single-spec: | |
runs-on: ubuntu-latest | |
container: | |
image: openapitools/openapi-generator-cli:v7.3.0 | |
env: | |
OPENAPI_GENERATOR_COMMAND: docker-entrypoint.sh | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pre-requisites | |
run: | | |
apt-get update | |
apt-get install -yqq \ | |
gettext-base | |
- name: Build single-file Onfido OpenAPI defintions | |
run: | | |
./generator/script/generate.sh \ | |
generator/configuration/openapi.yaml \ | |
generator/configuration/openapi-yaml.yaml | |
- name: Store generated artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: artifacts-${{ github.workflow }}-${{ github.run_id }}-${{ github.run_number }} | |
path: generated/artifacts | |
commit-single-spec: | |
runs-on: ubuntu-latest | |
needs: build-single-spec | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: artifacts-${{ github.workflow }}-${{ github.run_id }}-${{ github.run_number }} | |
path: generated/artifacts | |
- name: Commit single-file Onfido OpenAPI defintions | |
if: github.event_name == 'push' | |
run: | | |
git --version | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
git diff | |
git status --porcelain && git add generated/artifacts && \ | |
git commit -m "Update single file spec" && \ | |
git push |