diff --git a/.github/scripts/buildDocs.sh b/.github/scripts/buildDocs.sh old mode 100755 new mode 100644 index f2e2b4da0..519c685c6 --- a/.github/scripts/buildDocs.sh +++ b/.github/scripts/buildDocs.sh @@ -1,21 +1,19 @@ #!/bin/sh + FRAMES_JSON=Frames.json CHECKOUT_JSON=Checkout.json # generate sourcekitten JSONs for modules echo "Parsing Frames" sourcekitten doc -- -workspace "iOS Example Frame/iOS Example Frame.xcworkspace" -scheme Frames -destination generic/platform=iOS > $FRAMES_JSON -echo "" echo "Parsing Checkout" -sourcekitten doc -- -workspace Checkout/CocoapodsSample/CheckoutCocoapodsSample.xcworkspace -scheme Checkout -destination generic/platform=iOS > $CHECKOUT_JSON -echo "" +sourcekitten doc -- -workspace Checkout/Samples/CocoapodsSample/CheckoutCocoapodsSample.xcworkspace -scheme Checkout -destination generic/platform=iOS > $CHECKOUT_JSON # combine JSONs to build jazzy docs echo "Building docs" jazzy --sourcekitten-sourcefile $FRAMES_JSON,$CHECKOUT_JSON -echo "" # cleanup JSONs echo "Cleaning up..." diff --git a/.github/workflows/generate-jazzy-docs.yml b/.github/workflows/generate-jazzy-docs.yml new file mode 100644 index 000000000..b7dfbd0c7 --- /dev/null +++ b/.github/workflows/generate-jazzy-docs.yml @@ -0,0 +1,62 @@ +name: Generate Jazzy Docs + +on: + workflow_dispatch + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + generate-jazzy-docs: + name: Generate Docs + runs-on: macos-latest + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Ruby + uses: ruby/setup-ruby@5311f05890856149502132d25c4a24985a00d426 + with: + ruby-version: 3.2.2 + + - name: Install SourceKitten + run: | + brew install sourcekitten + + - name: Install Jazzy + run: | + gem install jazzy + + - name: Pod Install Frames + run: | + cd "iOS Example Frame" + pod install + + - name: Pod Install Checkout + run: | + cd "Checkout/Samples/CocoapodsSample" + pod install + + - name: Generate Docs + run: sh .github/scripts/buildDocs.sh + + - name: Upload Generated Jazzy Docs + uses: actions/upload-artifact@v3 + with: + name: Jazzy Docs + path: ".github/docs" + + - name: Create Branch + env: + BRANCH_NAME: "update/jazzy-docs" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git branch $BRANCH_NAME + git checkout $BRANCH_NAME + git add . + git commit -m "Update jazzy docs" + git push -u origin $BRANCH_NAME --force diff --git a/.jazzy.yaml b/.jazzy.yaml index 610e2474a..5a5b3dcb5 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -4,7 +4,7 @@ author_url: https://www.checkout.com/ source_host: github source_host_url: https://github.com/checkout/frames-ios source_host_files_url: https://github.com/checkout/frames-ios/tree/main -output: docs +output: .github/docs theme: .jazzy/.themes/checkout.com clean: true documentation: Documentation/**/*.md