Skip to content

Commit ddb23cd

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

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

.github/workflows/publish-docs.yml

+29-6
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,43 @@ 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+
- name: Deploy OpenAPI
31+
uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c # v4.6.4
32+
with:
33+
folder: openapi
34+
target-folder: openapi
2535
- uses: ruby/setup-ruby@v1
2636
with:
2737
ruby-version: 3.1
2838
bundler-cache: true
2939
working-directory: tech-docs
30-
- name: Build
40+
- name: Build Docs
3141
run: |
3242
gem install middleman
3343
bundle exec middleman build --verbose
3444
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
3945
- uses: actions/upload-artifact@v4
4046
with:
41-
path: tech-docs/build
47+
name: documentation
48+
path: tech-docs/build/
49+
50+
deploy:
51+
runs-on: ubuntu-latest
52+
if: github.ref_name == 'main' || (github.event_name == 'workflow_dispatch')
53+
needs:
54+
- build
55+
steps:
56+
- uses: actions/checkout@v4
57+
- uses: actions/download-artifact@v4
58+
with:
59+
name: documentation
60+
path: tech-docs-build
61+
- name: Deploy
62+
uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c # v4.6.4
63+
with:
64+
folder: tech-docs-build

0 commit comments

Comments
 (0)