fix: move checkout from composite action to running action #19
This file contains hidden or 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 Swagger UI for API specs of data models | |
| 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: gh-pages-deployment | |
| 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 | |
| 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 }} |