Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Nightly build and deploy

on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-and-deploy:
if: github.repository == 'heckj/docs'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
container:
image: swift:6.3
steps:
- uses: actions/checkout@v7

- uses: actions/cache@v5
with:
path: .workspace
key: docs-workspace-${{ hashFiles('scripts/sources.json') }}
restore-keys: |
docs-workspace-

- name: Install Python
run: apt-get update && apt-get install -y python3

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Build documentation
run: python3 scripts/build_docs.py --output-dir "$GITHUB_WORKSPACE/build-output" --extra-hosting-prefix docs

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'build-output'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
9 changes: 7 additions & 2 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@ To build the combined documentation and view the result locally:
```bash
set -e
./scripts/build_docs.py
python3 -m http.server 8000 --directory .build-output
python3 -m http.server 8123 --directory .build-output
```

Then in another terminal:

```bash
open http://localhost:8000/main/documentation/
open http://localhost:8123/main/documentation/
```

Serve from `.build-output` (the parent), not `.build-output/main`: the build
bakes a `/main/` hosting base path into every asset URL, so the `/main/` prefix
must map to the `main/` directory. This example avoids port 8000, which can be
commonly used by other apps or examples.

## Navigation manifest (combined sidebar curation)

`navigation.json` controls the left-hand navigator of the **combined** archive
Expand Down
32 changes: 16 additions & 16 deletions scripts/navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,26 @@
"version": 1,
"groups": [
{
"title": "Essential Libraries",
"title": "Swift",
"modules": [
{ "source": "swift-book", "path": "/documentation/the-swift-programming-language" },
{ "source": "swift-stdlib", "path": "/documentation/swift" },
{ "source": "swift-migration-guide", "path": "/documentation/migrationguide" },
{ "source": "compiler-diagnostics", "path": "/documentation/diagnostics" },
{ "source": "swift-testing", "path": "/documentation/testing" }
]
{ "source": "swift-migration-guide", "path": "/documentation/migrationguide" }
]
},
{
"title": "Package Manager",
"modules": [
{ "source": "swiftpm", "path": "/documentation/packagemanagerdocs", "title": "Swift Package Manager" },
{ "source": "swiftpm", "path": "/documentation/packagedescription" },
{ "source": "swiftpm", "path": "/documentation/packageplugin" }
]
},
{
"title": "Server-Side Swift",
"title": "Essential Libraries",
"modules": [
{ "source": "server-guides", "path": "/documentation/serverguides" },
{ "source": "swift-server-todos-tutorial", "path": "/tutorials/getting-started-swift-server" }
{ "source": "swift-stdlib", "path": "/documentation/swift" },
{ "source": "swift-testing", "path": "/documentation/testing" }
]
},
{
"title": "Tools",
"modules": [
{ "source": "swiftpm", "path": "/documentation/packagemanagerdocs", "title": "Swift Package Manager" },
{ "source": "swiftpm", "path": "/documentation/packagedescription" },
{ "source": "swiftpm", "path": "/documentation/packageplugin" },
{ "source": "docc-documentation", "path": "/documentation/docc" },
{ "source": "vscode-swift", "path": "/documentation/userdocs", "title": "Swift for VS Code" },
{ "source": "swiftly", "path": "/documentation/swiftlydocs", "title": "Swiftly" }
Expand All @@ -41,6 +34,13 @@
{ "source": "swift-wasm", "path": "/documentation/wasmguide" },
{ "source": "swift-android", "path": "/documentation/swiftandroid" }
]
},
{
"title": "Server-Side Swift",
"modules": [
{ "source": "server-guides", "path": "/documentation/serverguides" },
{ "source": "swift-server-todos-tutorial", "path": "/tutorials/getting-started-swift-server" }
]
}
],
"hidden": [
Expand Down
2 changes: 1 addition & 1 deletion scripts/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"type": "git",
"repo": "https://github.com/swiftlang/swift-embedded-examples.git",
"ref": "main",
"docc_catalog": "Sources/EmbeddedSwift/EmbeddedSwift.docc"
"targets": ["EmbeddedSwift"]
},
{
"id": "swift-wasm",
Expand Down