diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml new file mode 100644 index 00000000..b112b61f --- /dev/null +++ b/.github/workflows/docc.yml @@ -0,0 +1,46 @@ +name: Deploy Documentation +on: + push: + branches: [main, dev] + workflow_dispatch: +permissions: + contents: read + pages: write + id-token: write +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + runs-on: macos-13 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: "15.0.0" + - name: Setup Config file + run: | + cp Basic-Car-Maintenance.xcconfig.template Basic-Car-Maintenance.xcconfig + - name: Run Build Docs + run: ./build-docc.sh + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: .docs + deploy: + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} diff --git a/.swiftlint.yml b/.swiftlint.yml index 1e986c42..78299967 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -21,7 +21,8 @@ excluded: # paths to ignore during linting. Takes precedence over `included`. - Pods - Source/ExcludedFolder - Source/ExcludedFile.swift - - Source/*/ExcludedFile.swift # Exclude files with a wildcard + - Source/*/ExcludedFile.swift + - .derivedData # Exclude files with a wildcard analyzer_rules: # Rules run by `swiftlint analyze` (experimental) - explicit_self diff --git a/build-docc.sh b/build-docc.sh new file mode 100755 index 00000000..1053512c --- /dev/null +++ b/build-docc.sh @@ -0,0 +1,15 @@ +##!/bin/sh + +xcrun xcodebuild docbuild \ + -scheme Basic-Car-Maintenance \ + -destination 'generic/platform=iOS Simulator' \ + -derivedDataPath "$PWD/.derivedData" + +xcrun docc process-archive transform-for-static-hosting \ + "$PWD/.derivedData/Build/Products/Debug-iphonesimulator/Basic-Car-Maintenance.doccarchive" \ + --output-path ".docs" \ + --hosting-base-path "Basic-Car-Maintenance" + +echo '' > .docs/index.html + +