Skip to content

Commit 0118b65

Browse files
committed
PI-2374: Add deployment stage to publishing workflow
1 parent ea62141 commit 0118b65

File tree

1 file changed

+45
-7
lines changed

1 file changed

+45
-7
lines changed

.github/workflows/publish-docs.yml

+45-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
push:
66

77
jobs:
8-
build:
8+
deploy-openapi:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
@@ -22,20 +22,58 @@ jobs:
2222
timeout 300 sh -c 'until curl -s localhost:8080/v3/api-docs; do sleep 5; done'
2323
env:
2424
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
2546
- uses: ruby/setup-ruby@v1
2647
with:
2748
ruby-version: 3.1
2849
bundler-cache: true
2950
working-directory: tech-docs
30-
- name: Build
51+
- name: Build Docs
3152
run: |
3253
gem install middleman
3354
bundle exec middleman build --verbose
3455
working-directory: tech-docs
35-
- name: Bundle OpenAPI specs
36-
run: |
37-
curl -sf localhost:8080/v3/api-docs -o api-docs.json
38-
working-directory: tech-docs/build
3956
- uses: actions/upload-artifact@v4
4057
with:
41-
path: tech-docs/build
58+
name: documentation
59+
path: tech-docs/build/
60+
61+
deploy-docs:
62+
runs-on: ubuntu-latest
63+
if: github.ref_name == 'main' || (github.event_name == 'workflow_dispatch')
64+
needs:
65+
- build-docs
66+
steps:
67+
- uses: actions/checkout@v4
68+
- uses: actions/download-artifact@v4
69+
with:
70+
name: documentation
71+
path: tech-docs-build
72+
- uses: actions/download-artifact@v4
73+
with:
74+
name: openapi
75+
path: tech-docs-build
76+
- name: Deploy
77+
uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c # v4.6.4
78+
with:
79+
folder: tech-docs-build

0 commit comments

Comments
 (0)