generated from ministryofjustice/hmpps-template-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PI-2373: Add consolidated documentation publisher action
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Publish HMPPS Integration API Documentation | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
jobs: | ||
build: | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.1 | ||
bundler-cache: true | ||
working-directory: tech-docs | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
- uses: gradle/actions/setup-gradle@v4 | ||
- name: Serve dependencies | ||
run: make serve-dependencies | ||
- name: Start service | ||
run: | | ||
./gradlew bootRun & | ||
timeout 300 sh -c 'until curl -s localhost:8080/v3/api-docs; do sleep 5; done' | ||
env: | ||
SPRING_PROFILES_ACTIVE: local | ||
- name: Fetch API docs | ||
run: mkdir -p openapi && curl -f localhost:8080/v3/api-docs -o openapi/api-docs.json | ||
- name: Build | ||
run: | | ||
gem install middleman | ||
bundle exec middleman build --verbose | ||
working-directory: tech-docs | ||
- name: Bundle OpenAPI specs | ||
run: | | ||
curl -sf localhost:8080/v3/api-docs -o api-docs.json | ||
working-directory: tech-docs/build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: tech-docs/build |