Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generate-jazzy-docs.yml #474

Merged
merged 1 commit into from
Sep 19, 2023
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
6 changes: 2 additions & 4 deletions .github/scripts/buildDocs.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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..."
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/generate-jazzy-docs.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down