Bump github.com/apple/swift-crypto from 1.1.7 to 3.2.0 (#25) #9
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: Generate DocC | |
on: | |
push: | |
branches: [ main ] | |
env: | |
GH-PAGES-BRANCH: 'gh-pages' | |
GH-PAGES-PATH: 'gh-pages' | |
BUILD-SCHEME: 'ImageFetcher' | |
DERIVED-DATA-PATH: '/Users/runner/docbuild' | |
HOSTING-BASE-PATH: 'ImageFetcher' | |
jobs: | |
Build-Github-Actions: | |
runs-on: macos-12 | |
steps: | |
- name: Git Checkout main | |
uses: actions/checkout@v3 | |
- name: Git Checkout gh-pages | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.GH-PAGES-BRANCH }} | |
path: ${{ env.GH-PAGES-PATH }} | |
- name: Build Doc Bundle | |
run: | | |
echo "Building Documentation..." | |
xcodebuild docbuild -scheme ${{ env.BUILD-SCHEME }} -derivedDataPath ${{ env.DERIVED-DATA-PATH }} -destination 'platform=macOS' > build_output.txt | |
# Uncomment to see build output | |
# cat build_output.txt | |
# Find documentation inside docbuild | |
DOCC_DIR=`find ${{ env.DERIVED-DATA-PATH }} -type d -iname "${{ env.BUILD-SCHEME }}.doccarchive"` | |
# Pretty print DocC JSON output so that it can be consistently diffed between commits | |
export DOCC_JSON_PRETTYPRINT=YES | |
echo "Exporting Documentation..." | |
$(xcrun --find docc) process-archive \ | |
transform-for-static-hosting "$DOCC_DIR" \ | |
--output-path ./${{ env.GH-PAGES-PATH }}/docs \ | |
--hosting-base-path ${{ env.HOSTING-BASE-PATH }} | |
- name: Commit | |
id: commit | |
run: | | |
CURRENT_COMMIT_HASH=`git rev-parse --short HEAD` | |
cd ${{ env.GH-PAGES-PATH }} | |
git add docs | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "Documentation changes found. Commiting the changes to the pages branch and pushing to origin." | |
git commit -m "Update GitHub Pages documentation site to '$CURRENT_COMMIT_HASH'." | |
git push origin HEAD:${{ env.GH-PAGES-BRANCH }} | |
else | |
# No changes found, nothing to commit. | |
echo "No documentation changes found." | |
fi |