Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add github action to build docs #55

Merged
merged 1 commit into from
Jul 2, 2023
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
45 changes: 45 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish Docs

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: macos-12
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Package documentation 🛠
run: |
export DOCC_JSON_PRETTYPRINT="YES"
swift package \
--allow-writing-to-directory ./docs \
generate-documentation --target WMATAUI \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path WMATAUI \
--output-path ./docs
- name: Upload artifact 📜
uses: actions/upload-pages-artifact@v1
with:
# Upload docs directory
path: 'docs'
- name: Deploy to GitHub Pages 🐙
id: deployment
uses: actions/deploy-pages@v1
18 changes: 18 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
{
"pins" : [
{
"identity" : "swift-docc-plugin",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-plugin",
"state" : {
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247",
"version" : "1.3.0"
}
},
{
"identity" : "swift-docc-symbolkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-symbolkit",
"state" : {
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34",
"version" : "1.0.0"
}
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
Expand Down
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/emma-k-alexandra/WMATA.swift", from: "15.1.0"),
.package(url: "https://github.com/nalexn/ViewInspector", from: "0.9.7")
.package(url: "https://github.com/nalexn/ViewInspector", from: "0.9.7"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0")
],
targets: [
.target(
Expand Down