Skip to content

chore: rename workflow example and test global reference #1

chore: rename workflow example and test global reference

chore: rename workflow example and test global reference #1

name: Example n5geh data model workflow
description: |
This workflow generates Swagger UI for API specs of data models and deploys them to GitHub Pages.
It uses preconfigured composite actions to setup and then generate the Swagger UI and ultimately deploy the site.
env:
JSON_SCHEMA_PATH: example_building_automation/schemas
OUTPUT_ROOT_PATH: example_building_automation/deploy
API_DOCS_PATH: example_building_automation/api_docs
on:
push:
# Adjust branches as needed
branches:
- main
jobs:
set-matrix:
runs-on: ubuntu-latest
concurrency:
group: data-models-set-matrix
cancel-in-progress: false
outputs:
matrix: ${{ steps.build_matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build matrix from API docs
id: build_matrix
# uses: ./.github/actions/find-openapi-spec
uses: N5GEH/n5geh.data_models/.github/actions/find-openapi-spec@main
with:
API_DOCS_PATH: ${{ env.API_DOCS_PATH }}
generate-swagger-ui:
needs: set-matrix
runs-on: ubuntu-latest
strategy:
# Use the dynamically generated matrix.
# Each job will process one API spec file.
matrix:
include: ${{ fromJson(needs.set-matrix.outputs.matrix) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate Swagger UI using composite action
uses: ./.github/actions/generate-swagger-ui
with:
spec: ${{ matrix.spec }}
base: ${{ matrix.base }}
output: ${{ matrix.output }}
JSON_SCHEMA_PATH: ${{ env.JSON_SCHEMA_PATH }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy-gh-pages:
runs-on: ubuntu-latest
needs: generate-swagger-ui
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Deploy the site via composite action
uses: ./.github/actions/deploy-gh-pages
with:
OUTPUT_ROOT_PATH: ${{ env.OUTPUT_ROOT_PATH }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}