diff --git a/.github/workflows/pr_closed.yaml b/.github/workflows/pr_closed.yaml index 003cf976..74b1a304 100644 --- a/.github/workflows/pr_closed.yaml +++ b/.github/workflows/pr_closed.yaml @@ -157,3 +157,40 @@ jobs: run: npm publish --workspace internal/events env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + + publish-api-specs: + name: Generate and publish API specs to APIM pre-release artefacts + #if: needs.check-merge-or-workflow-dispatch.outputs.deploy == 'true' + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + strategy: + max-parallel: 1 + matrix: + apim-env: [internal-dev, int, ref, prod] + steps: + - name: Checkout code + uses: actions/checkout@v5.0.0 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install dependencies + working-directory: . + run: npm ci + shell: bash + + - name: Generate OpenAPI specification + run: | + echo "Building env specific OAS spec" + make build-json-oas-spec APIM_ENV=${{ matrix.apim-env }} + + - name: Upload API spec artefact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.apim-env }}-build-output + path: ./build