Skip to content

Commit ac3253c

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

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

.github/workflows/publish-docs.yml

+36-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,49 @@ 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+
needs:
39+
- deploy-openapi
40+
steps:
2541
- uses: ruby/setup-ruby@v1
2642
with:
2743
ruby-version: 3.1
2844
bundler-cache: true
2945
working-directory: tech-docs
30-
- name: Build
46+
- name: Build Docs
3147
run: |
3248
gem install middleman
3349
bundle exec middleman build --verbose
3450
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
3951
- uses: actions/upload-artifact@v4
4052
with:
41-
path: tech-docs/build
53+
name: documentation
54+
path: tech-docs/build/
55+
56+
deploy-docs:
57+
runs-on: ubuntu-latest
58+
if: github.ref_name == 'main' || (github.event_name == 'workflow_dispatch')
59+
needs:
60+
- build-docs
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: actions/download-artifact@v4
64+
with:
65+
name: documentation
66+
path: tech-docs-build
67+
- name: Deploy
68+
uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c # v4.6.4
69+
with:
70+
folder: tech-docs-build

0 commit comments

Comments
 (0)