Skip to content

Commit a144c30

Browse files
committed
chore: Refactor mdBook workflow to improve efficiency
1 parent d5f19a4 commit a144c30

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

.github/workflows/deploy-gh-pages.yaml

+17-14
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,46 @@ permissions:
1515
id-token: write
1616

1717
jobs:
18-
build:
18+
# Build mdbook
19+
build-mdbook:
1920
runs-on: ubuntu-latest
20-
strategy:
21-
matrix:
22-
service:
23-
- account
24-
- content-watcher
25-
- content-publishing
26-
- graph
27-
2821
steps:
2922
- name: Checkout
3023
uses: actions/checkout@v4
3124

3225
- name: Set up mdBook 📚
33-
if: matrix.service == 'account' # Only upload mdbook once
3426
uses: ./.github/workflows/common/set-up-mdbook
3527
with:
3628
token: ${{secrets.GITHUB_TOKEN}}
3729
- name: Setup Pages
38-
if: matrix.service == 'account' # Only setup Pages once
3930
id: pages
4031
uses: actions/configure-pages@v4
4132

4233
- name: Build with mdBook
43-
if: matrix.service == 'account' # Only build mdbook once
4434
working-directory: docs
4535
run: mdbook build && ls book
4636

4737
# Upload the mdBook output to GitHub Pages
4838
- name: Upload mdbook to GitHub Pages
49-
if: matrix.service == 'account' # Only upload mdbook once
5039
uses: actions/upload-artifact@v4
5140
with:
5241
name: mdbook
5342
path: ./docs
5443

44+
build:
45+
runs-on: ubuntu-latest
46+
strategy:
47+
matrix:
48+
service:
49+
- account
50+
- content-watcher
51+
- content-publishing
52+
- graph
53+
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
5558
# Publish OpenAPI specs for each microservice
5659
- name: Build and Publish OpenAPI spec for ${{ matrix.service }}
5760
uses: ./.github/workflows/common/openapi-build
@@ -68,7 +71,7 @@ jobs:
6871
deploy:
6972
name: Deploy mdbook and OpenAPI microservices to GitHub Pages
7073
runs-on: ubuntu-latest
71-
needs: build
74+
needs: [build, build-mdbook]
7275
environment:
7376
name: github-pages
7477
url: ${{ steps.deployment.outputs.page_url }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)