Skip to content

Commit 61beec3

Browse files
authored
PI-2373: Publish Docs (#496)
* PI-2373: Add consolidated documentation publisher action * PI-2373: Remove unused actions workflows * PI-2374: Add deployment stage to publishing workflow * PI-2373: Add draft publishing
1 parent d3b8101 commit 61beec3

File tree

6 files changed

+262
-94
lines changed

6 files changed

+262
-94
lines changed

.github/workflows/generate-api-docs.yml

-33
This file was deleted.

.github/workflows/publish-docs.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Publish HMPPS Integration API Documentation
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
jobs:
8+
deploy-openapi:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-java@v4
13+
with:
14+
java-version: '21'
15+
distribution: 'temurin'
16+
- uses: gradle/actions/setup-gradle@v4
17+
- name: Serve dependencies
18+
run: make serve-dependencies
19+
- name: Start service
20+
run: |
21+
./gradlew bootRun &
22+
timeout 300 sh -c 'until curl -s localhost:8080/v3/api-docs; do sleep 5; done'
23+
env:
24+
SPRING_PROFILES_ACTIVE: local
25+
- name: Bundle OpenAPI specs
26+
run: |
27+
mkdir openapi
28+
curl -sf localhost:8080/v3/api-docs -o openapi/api-docs.json
29+
working-directory: .
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
name: openapi
33+
path: openapi/
34+
- name: Deploy OpenAPI
35+
uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c # v4.6.4
36+
with:
37+
folder: openapi
38+
target-folder: openapi
39+
40+
build-docs:
41+
runs-on: ubuntu-latest
42+
needs:
43+
- deploy-openapi
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: ruby/setup-ruby@v1
47+
with:
48+
ruby-version: 3.1
49+
bundler-cache: true
50+
working-directory: tech-docs
51+
- name: Build Docs
52+
run: |
53+
gem install middleman
54+
bundle exec middleman build --verbose
55+
working-directory: tech-docs
56+
- uses: actions/upload-artifact@v4
57+
with:
58+
name: documentation
59+
path: tech-docs/build/
60+
61+
deploy-docs:
62+
runs-on: ubuntu-latest
63+
needs:
64+
- build-docs
65+
steps:
66+
- uses: actions/checkout@v4
67+
- uses: actions/download-artifact@v4
68+
with:
69+
name: documentation
70+
path: tech-docs-build
71+
- uses: actions/download-artifact@v4
72+
with:
73+
name: openapi
74+
path: tech-docs-build/openapi/
75+
- name: Deploy
76+
if: github.ref_name == 'main'
77+
uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c # v4.6.4
78+
with:
79+
folder: tech-docs-build
80+
target-folder: tech-docs
81+
- name: Deploy branch
82+
if: github.ref_name != 'main'
83+
uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c # v4.6.4
84+
with:
85+
folder: tech-docs-build
86+
target-folder: drafts/${{ github.ref_name }}

.github/workflows/publish.yml

-53
This file was deleted.

tech-docs/Gemfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
source "https://rubygems.org"
2-
ruby "3.1.0"
2+
3+
# Include the tech docs gem
4+
gem 'govuk_tech_docs'

tech-docs/Gemfile.lock

+167-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,177 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4+
activesupport (7.0.7.2)
5+
concurrent-ruby (~> 1.0, >= 1.0.2)
6+
i18n (>= 1.6, < 2)
7+
minitest (>= 5.1)
8+
tzinfo (~> 2.0)
9+
addressable (2.8.4)
10+
public_suffix (>= 2.0.2, < 6.0)
11+
autoprefixer-rails (10.4.13.0)
12+
execjs (~> 2)
13+
backports (3.24.1)
14+
chronic (0.10.2)
15+
chunky_png (1.4.0)
16+
coffee-script (2.4.1)
17+
coffee-script-source
18+
execjs
19+
coffee-script-source (1.12.2)
20+
commonmarker (0.23.10)
21+
compass (1.0.3)
22+
chunky_png (~> 1.2)
23+
compass-core (~> 1.0.2)
24+
compass-import-once (~> 1.0.5)
25+
rb-fsevent (>= 0.9.3)
26+
rb-inotify (>= 0.9)
27+
sass (>= 3.3.13, < 3.5)
28+
compass-core (1.0.3)
29+
multi_json (~> 1.0)
30+
sass (>= 3.3.0, < 3.5)
31+
compass-import-once (1.0.5)
32+
sass (>= 3.2, < 3.5)
33+
concurrent-ruby (1.2.2)
34+
contracts (0.17)
35+
dotenv (2.8.1)
36+
em-websocket (0.5.3)
37+
eventmachine (>= 0.12.9)
38+
http_parser.rb (~> 0)
39+
erubis (2.7.0)
40+
eventmachine (1.2.7)
41+
execjs (2.8.1)
42+
fast_blank (1.0.1)
43+
fastimage (2.2.6)
44+
ffi (1.15.5)
45+
govuk_tech_docs (3.3.1)
46+
autoprefixer-rails (~> 10.2)
47+
chronic (~> 0.10.2)
48+
middleman (~> 4.0)
49+
middleman-autoprefixer (~> 2.10.0)
50+
middleman-compass (>= 4.0.0)
51+
middleman-livereload
52+
middleman-search-gds
53+
middleman-sprockets (~> 4.0.0)
54+
middleman-syntax (~> 3.2.0)
55+
nokogiri
56+
openapi3_parser (~> 0.9.0)
57+
redcarpet (~> 3.5.1)
58+
haml (5.2.2)
59+
temple (>= 0.8.0)
60+
tilt
61+
hamster (3.0.0)
62+
concurrent-ruby (~> 1.0)
63+
hashie (3.6.0)
64+
http_parser.rb (0.8.0)
65+
i18n (1.6.0)
66+
concurrent-ruby (~> 1.0)
67+
kramdown (2.4.0)
68+
rexml
69+
listen (3.8.0)
70+
rb-fsevent (~> 0.10, >= 0.10.3)
71+
rb-inotify (~> 0.9, >= 0.9.10)
72+
memoist (0.16.2)
73+
middleman (4.4.3)
74+
coffee-script (~> 2.2)
75+
haml (>= 4.0.5, < 6.0)
76+
kramdown (>= 2.3.0)
77+
middleman-cli (= 4.4.3)
78+
middleman-core (= 4.4.3)
79+
middleman-autoprefixer (2.10.0)
80+
autoprefixer-rails (>= 9.1.4)
81+
middleman-core (>= 3.3.3)
82+
middleman-cli (4.4.3)
83+
thor (>= 0.17.0, < 2.0)
84+
middleman-compass (4.0.1)
85+
compass (>= 1.0.0, < 2.0.0)
86+
middleman-core (>= 4.0.0)
87+
middleman-core (4.4.3)
88+
activesupport (>= 6.1, < 7.1)
89+
addressable (~> 2.4)
90+
backports (~> 3.6)
91+
bundler (~> 2.0)
92+
contracts (~> 0.13)
93+
dotenv
94+
erubis
95+
execjs (~> 2.0)
96+
fast_blank
97+
fastimage (~> 2.0)
98+
hamster (~> 3.0)
99+
hashie (~> 3.4)
100+
i18n (~> 1.6.0)
101+
listen (~> 3.0)
102+
memoist (~> 0.14)
103+
padrino-helpers (~> 0.15.0)
104+
parallel
105+
rack (>= 1.4.5, < 3)
106+
sassc (~> 2.0)
107+
servolux
108+
tilt (~> 2.0.9)
109+
toml
110+
uglifier (~> 3.0)
111+
webrick
112+
middleman-livereload (3.4.7)
113+
em-websocket (~> 0.5.1)
114+
middleman-core (>= 3.3)
115+
rack-livereload (~> 0.3.15)
116+
middleman-search-gds (0.11.2)
117+
execjs (~> 2.6)
118+
middleman-core (>= 3.2)
119+
nokogiri (~> 1.6)
120+
middleman-sprockets (4.0.0)
121+
middleman-core (~> 4.0)
122+
sprockets (>= 3.0)
123+
middleman-syntax (3.2.0)
124+
middleman-core (>= 3.2)
125+
rouge (~> 3.2)
126+
minitest (5.18.0)
127+
multi_json (1.15.0)
128+
nokogiri (1.16.5-x86_64-linux)
129+
racc (~> 1.4)
130+
openapi3_parser (0.9.2)
131+
commonmarker (~> 0.17)
132+
padrino-helpers (0.15.3)
133+
i18n (>= 0.6.7, < 2)
134+
padrino-support (= 0.15.3)
135+
tilt (>= 1.4.1, < 3)
136+
padrino-support (0.15.3)
137+
parallel (1.22.1)
138+
parslet (2.0.0)
139+
public_suffix (5.0.1)
140+
racc (1.7.3)
141+
rack (2.2.8.1)
142+
rack-livereload (0.3.17)
143+
rack
144+
rb-fsevent (0.11.2)
145+
rb-inotify (0.10.1)
146+
ffi (~> 1.0)
147+
redcarpet (3.5.1)
148+
rexml (3.3.6)
149+
strscan
150+
rouge (3.30.0)
151+
sass (3.4.25)
152+
sassc (2.4.0)
153+
ffi (~> 1.9)
154+
servolux (0.13.0)
155+
sprockets (4.2.0)
156+
concurrent-ruby (~> 1.0)
157+
rack (>= 2.2.4, < 4)
158+
strscan (3.1.0)
159+
temple (0.10.0)
160+
thor (1.2.1)
161+
tilt (2.0.11)
162+
toml (0.3.0)
163+
parslet (>= 1.8.0, < 3.0.0)
164+
tzinfo (2.0.6)
165+
concurrent-ruby (~> 1.0)
166+
uglifier (3.2.0)
167+
execjs (>= 0.3.0, < 3)
168+
webrick (1.8.1)
4169

5170
PLATFORMS
6-
arm64-darwin-21
7-
x64-mingw32
8-
x86_64-darwin-20
9171
x86_64-linux
10172

11173
DEPENDENCIES
12-
13-
RUBY VERSION
14-
ruby 3.1.0
174+
govuk_tech_docs
15175

16176
BUNDLED WITH
17-
2.4.5
177+
2.3.26

tech-docs/config.rb

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require "govuk_tech_docs"
2+
3+
GovukTechDocs.configure(self)
4+
5+
activate :relative_assets
6+
set :relative_links, true

0 commit comments

Comments
 (0)