Skip to content

Commit 78a639e

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

File tree

1 file changed

+37
-7
lines changed

1 file changed

+37
-7
lines changed

.github/workflows/publish-docs.yml

+37-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,50 @@ 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:
41+
- uses: actions/checkout@v4
2542
- uses: ruby/setup-ruby@v1
2643
with:
2744
ruby-version: 3.1
2845
bundler-cache: true
2946
working-directory: tech-docs
30-
- name: Build
47+
- name: Build Docs
3148
run: |
3249
gem install middleman
3350
bundle exec middleman build --verbose
3451
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
3952
- uses: actions/upload-artifact@v4
4053
with:
41-
path: tech-docs/build
54+
name: documentation
55+
path: tech-docs/build/
56+
57+
deploy-docs:
58+
runs-on: ubuntu-latest
59+
if: github.ref_name == 'main' || (github.event_name == 'workflow_dispatch')
60+
needs:
61+
- build-docs
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: actions/download-artifact@v4
65+
with:
66+
name: documentation
67+
path: tech-docs-build
68+
- name: Deploy
69+
uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c # v4.6.4
70+
with:
71+
folder: tech-docs-build

0 commit comments

Comments
 (0)