Skip to content

Merge pull request #237 from okta/WebAuthnUpdates #141

Merge pull request #237 from okta/WebAuthnUpdates

Merge pull request #237 from okta/WebAuthnUpdates #141

name: Deploy Documentation
on:
push:
branches:
- master
tags:
- '*'
env:
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer
NSUnbufferedIO: YES
# NOTE: The DocC `generate-documentation` plugin does not handle the
# hostingBasePath well. In particular, it doesn't properly handle
# multiple child paths. Furthermore, the current 1.0.0 version of
# the plugin doesn't handle updates to the index.html or *.js
# files.
#
# This workflow should be revisited once Xcode 14 GA is released
# so the newer DocC utilities can be utilized.
jobs:
ExportToGHPages:
name: Export to Github Pages
runs-on: macos-latest-large
steps:
- uses: actions/checkout@master
- name: Build Documentation
run: |
set +ex
VERSION=${{ github.ref_name }}
if [[ "$VERSION" = "master" ]]; then
VERSION=development
fi
set -e
export DOCC_JSON_PRETTYPRINT=YES
TARGET_LIST=""
echo "Initializing target list"
for TARGET in $(swift package describe --type json | jq ".products[].name" | sed -e 's/"//g'); do
echo "🎯 $TARGET"
NAME=$(echo "$TARGET" | tr '[:upper:]' '[:lower:]')
TARGET_LIST="$TARGET_LIST --target $TARGET"
mkdir -p "docs/okta-mobile-swift/$VERSION/$NAME"
echo "<html><head><meta http-equiv='refresh' content='0;url=/okta-mobile-swift/$VERSION/documentation/$NAME/'></head></html>" > "docs/okta-mobile-swift/$VERSION/$NAME/index.html"
done
echo
echo "📓 Generating combined documentation"
swift package --allow-writing-to-directory docs generate-documentation \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path "okta-mobile-swift/$VERSION" \
--output-path "docs/okta-mobile-swift/$VERSION" \
--include-extended-types \
--enable-experimental-combined-documentation \
--enable-experimental-mentioned-in \
--enable-experimental-external-link-support \
$TARGET_LIST
- name: Deploy documentation to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
keep_files: true