Test that token refreshes merge the results correctly (#195) #116
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Documentation | |
on: | |
push: | |
branches: | |
- master | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_15.3.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=$(git describe --tags 2>/dev/null) | |
if [[ $? -ne 0 ]]; then | |
VERSION=development | |
fi | |
set -e | |
export DOCC_JSON_PRETTYPRINT=YES | |
for TARGET in $(swift package describe --type json | jq ".products[].name" | sed -e 's/"//g'); do | |
echo "Building $TARGET" | |
NAME=$(echo "$TARGET" | tr '[:upper:]' '[:lower:]') | |
mkdir -p docs/$VERSION/$NAME | |
swift package \ | |
--allow-writing-to-directory docs \ | |
generate-documentation \ | |
--target $TARGET \ | |
--disable-indexing \ | |
--transform-for-static-hosting \ | |
--hosting-base-path okta-mobile-swift/$VERSION/$NAME \ | |
--output-path docs/$VERSION/$NAME | |
sed -I -e "s#<head>#<head><meta http-equiv='refresh' content='0;url=./documentation/$NAME/'>#" \ | |
docs/$VERSION/$NAME/index.html | |
done | |
- name: Deploy documentation to Github Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs | |
keep_files: true |