Skip to content

Commit 7cdca3a

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

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

.github/workflows/publish-docs.yml

+34-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,47 @@ 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
35+
36+
build-docs:
37+
runs-on: ubuntu-latest
38+
steps:
2539
- uses: ruby/setup-ruby@v1
2640
with:
2741
ruby-version: 3.1
2842
bundler-cache: true
2943
working-directory: tech-docs
30-
- name: Build
44+
- name: Build Docs
3145
run: |
3246
gem install middleman
3347
bundle exec middleman build --verbose
3448
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
3949
- uses: actions/upload-artifact@v4
4050
with:
41-
path: tech-docs/build
51+
name: documentation
52+
path: tech-docs/build/
53+
54+
deploy-docs:
55+
runs-on: ubuntu-latest
56+
if: github.ref_name == 'main' || (github.event_name == 'workflow_dispatch')
57+
needs:
58+
- build
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: actions/download-artifact@v4
62+
with:
63+
name: documentation
64+
path: tech-docs-build
65+
- name: Deploy
66+
uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c # v4.6.4
67+
with:
68+
folder: tech-docs-build

0 commit comments

Comments
 (0)