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
46 changes: 46 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy Documentation

on:
push:
branches: [ master ]
workflow_dispatch:

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

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

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Build DocC
run: |
swift package --allow-writing-to-directory ./docs \
generate-documentation --target TimeIt \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path TimeIt \
--output-path ./docs

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
23 changes: 23 additions & 0 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:5.6
import PackageDescription

let package = Package(
Expand All @@ -8,7 +8,9 @@ let package = Package(
name: "TimeIt",
targets: ["TimeIt"]),
],
dependencies: [],
dependencies: [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
],
targets: [
.target(
name: "TimeIt",
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ TimeIt.complete(log: "myOperation") { logs in

## Documentation

Full API documentation is available as DocC documentation. To generate and view the documentation:
Full API documentation is available online at [https://mikelrob.github.io/TimeIt/documentation/timeit/](https://mikelrob.github.io/TimeIt/documentation/timeit/).

You can also generate and view the documentation locally:

```bash
swift package generate-documentation
Expand Down