Skip to content

Commit e109755

Browse files
authored
Add ability to regenerate all packages' docs at once by manually invoking deploy flow
1 parent e79492a commit e109755

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

.github/workflows/deploy-api-docs.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ on:
33
push:
44
branches:
55
- main
6+
workflow_dispatch:
7+
inputs:
8+
regenerate_all:
9+
description: "Force regeneration of every single package's API docs."
10+
required: false
11+
type: boolean
12+
default: false
613

714
jobs:
815
deploy:
916
name: Build and deploy
1017
runs-on: ubuntu-latest
11-
container: swift:5.8
18+
container: swiftlang/swift:nightly-5.9-jammy@sha256:a3c3ec5e4436c14e44759e38416bb0d46813dc6dd050e787ef3a80b2c3051a36
1219
steps:
1320
- name: Checkout
1421
uses: actions/checkout@v3
@@ -20,6 +27,33 @@ jobs:
2027
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
2128
unzip awscliv2.zip
2229
./aws/install
30+
- name: Regenerate all API docs if requested
31+
if: inputs.regenerate_all
32+
shell: bash
33+
run: |
34+
curl -sL \
35+
https://raw.githubusercontent.com/vapor/api-docs/main/generate-package-api-docs.swift -o generate-package-api-docs.swift \
36+
https://raw.githubusercontent.com/vapor/api-docs/main/theme-settings.json -o theme-settings.json
37+
for item in \
38+
vapor:Vapor vapor:XCTVapor \
39+
async-kit:AsyncKit routing-kit:RoutingKit console-kit:ConsoleKit \
40+
websocket-kit:WebSocketKit multipart-kit:MultipartKit \
41+
postgres-nio:PostgresNIO mysql-nio:MySQLNIO sqlite-nio:SQLiteNIO sql-kit:SQLKit \
42+
postgres-kit:PostgresKit mysql-kit:MySQLKit sqlite-kit:SQLiteKit fluent-kit:FluentKit \
43+
fluent-kit:FluentSQL fluent-kit:XCTFluent fluent:Fluent fluent-postgres-driver:FluentPostgresDriver \
44+
fluent-mongo-driver:FluentMongoDriver fluent-mysql-driver:FluentMySQLDriver fluent-sqlite-driver:FluentSQLiteDriver \
45+
redis:Redis queues-redis-driver:QueuesRedisDriver queues:Queues queues:XCTQueues \
46+
leaf-kit:LeafKit leaf:Leaf \
47+
jwt-kit:JWTKit jwt:JWT apns:APNS \
48+
do
49+
repo=${item%:*} module=${item#*:}
50+
if [[ ! -d ${repo} ]]; then
51+
git clone https://github.com/vapor/${repo}.git ${repo}
52+
fi
53+
cp theme-settings.json ${repo}
54+
(cd ${repo} && swift ../generate-package-api-docs.swift ${repo} ${module})
55+
cp -r ${repo}/public/* ./public
56+
done
2357
- name: Configure AWS Credentials
2458
uses: aws-actions/configure-aws-credentials@v2
2559
with:

0 commit comments

Comments
 (0)