Skip to content

Commit 20fcd47

Browse files
Improve documentation workflow and update README
1 parent 6c472f8 commit 20fcd47

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

.github/workflows/pages.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
deploy:
18+
build-and-deploy:
1919
environment:
2020
name: github-pages
2121
url: ${{ steps.deployment.outputs.page_url }}
@@ -24,6 +24,17 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@v4
2626

27+
- name: Setup Swift
28+
uses: swift-actions/setup-swift@v1
29+
with:
30+
swift-version: "5.9"
31+
32+
- name: Build DocC documentation
33+
run: |
34+
swift build
35+
chmod +x ./scripts/build-docs.sh
36+
./scripts/build-docs.sh
37+
2738
- name: Setup Pages
2839
uses: actions/configure-pages@v5
2940

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,27 @@ The tool has also been tested with the standard Swagger Pet Store OpenAPI defini
6262
swift run openapi-to-symbolgraph Examples/petstore.yaml --output-path petstore.symbolgraph.json
6363
```
6464

65-
2. Create a DocC documentation catalog (see `API.docc` as an example)
65+
2. Generate the documentation using our helper script:
6666

67-
3. Generate the documentation:
67+
```bash
68+
./scripts/build-docs.sh
69+
```
70+
71+
Or manually with DocC:
6872

6973
```bash
70-
xcrun docc convert YourAPI.docc --fallback-display-name YourAPI --fallback-bundle-identifier com.example.YourAPI --fallback-bundle-version 1.0.0 --additional-symbol-graph-dir ./ --output-path ./docs
74+
xcrun docc convert YourAPI.docc --fallback-display-name YourAPI --fallback-bundle-identifier com.example.YourAPI --fallback-bundle-version 1.0.0 --additional-symbol-graph-dir ./ --output-path ./docs --hosting-base-path OpenAPI-Integration-with-DocC
7175
```
7276

7377
## Viewing the Documentation
7478

75-
The `docs/` directory in this repository contains the pre-generated DocC documentation website output for the **Swagger Pet Store API**, which was built using the `petstore.symbolgraph.json` generated by this tool and the `API.docc` catalog.
79+
The `docs/` directory in this repository contains the pre-generated DocC documentation website output for the **Swift Package Registry API**, which was built using the `registry.symbolgraph.json` generated by this tool and the `RegistryAPI.docc` catalog.
7680

7781
### Documentation
7882

7983
The latest documentation is automatically deployed to GitHub Pages and can be viewed at:
8084

81-
[https://ayushshrivastv.github.io/OpenAPI-integration-with-DocC/](https://ayushshrivastv.github.io/OpenAPI-integration-with-DocC/)
85+
[https://ayushshrivastv.github.io/OpenAPI-Integration-with-DocC/](https://ayushshrivastv.github.io/OpenAPI-Integration-with-DocC/)
8286

8387
### Local Documentation Server
8488

@@ -87,7 +91,7 @@ You can serve the documentation locally using one of these methods:
8791
#### Using the helper script:
8892

8993
```bash
90-
./serve-docs.sh
94+
./scripts/serve-docs.sh
9195
```
9296

9397
#### Using Python 3 directly:
@@ -114,9 +118,10 @@ Check out the `DocsExample` directory for a working example of a REST API docume
114118
This repository is configured to automatically deploy documentation to GitHub Pages whenever changes are pushed to the main branch. The deployment process:
115119

116120
1. Uses the GitHub Actions workflow defined in `.github/workflows/pages.yml`
117-
2. Takes the contents of the `docs` directory
118-
3. Deploys them to GitHub Pages
119-
4. Makes the documentation available at the URL: [https://ayushshrivastv.github.io/OpenAPI-integration-with-DocC/](https://ayushshrivastv.github.io/OpenAPI-integration-with-DocC/)
121+
2. Builds the documentation from the OpenAPI specification
122+
3. Takes the contents of the `docs` directory
123+
4. Deploys them to GitHub Pages
124+
5. Makes the documentation available at the URL: [https://ayushshrivastv.github.io/OpenAPI-Integration-with-DocC/](https://ayushshrivastv.github.io/OpenAPI-Integration-with-DocC/)
120125

121126
## Contributing
122127

0 commit comments

Comments
 (0)