diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..74b5540 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -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 diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..eec9740 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,23 @@ +{ + "pins" : [ + { + "identity" : "swift-docc-plugin", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-docc-plugin", + "state" : { + "revision" : "3e4f133a77e644a5812911a0513aeb7288b07d06", + "version" : "1.4.5" + } + }, + { + "identity" : "swift-docc-symbolkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swiftlang/swift-docc-symbolkit", + "state" : { + "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", + "version" : "1.0.0" + } + } + ], + "version" : 2 +} diff --git a/Package.swift b/Package.swift index 82295dd..3860519 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.3 +// swift-tools-version:5.6 import PackageDescription let package = Package( @@ -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", diff --git a/README.md b/README.md index 41d5257..fa75b6d 100644 --- a/README.md +++ b/README.md @@ -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