Skip to content

Commit

Permalink
chore: Add github action to build docs (#55)
Browse files Browse the repository at this point in the history
Add the infrastructure for addressing #5 and #6 in subsequent pull requests.
  • Loading branch information
rhwood authored Jul 2, 2023
1 parent 7b18300 commit 4fa2a05
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
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

0 comments on commit 4fa2a05

Please sign in to comment.