Skip to content

Back merge Release/3.0.0 (#525) #248

Back merge Release/3.0.0 (#525)

Back merge Release/3.0.0 (#525) #248

Workflow file for this run

# Name your workflow.
name: Deploy Gravatar DocC
on:
# Runs on pushes and PRs targeting the default branch
push:
branches: [ "trunk" ]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
env:
GRAVATAR_URL: "gravatar"
GRAVATAR_UI_URL: "gravatarui"
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
# Must be set to this for deploying to GitHub Pages
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: macos-14
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Switch Xcode 🔄
run: sudo xcode-select --switch /Applications/Xcode_15.4.app
- name: Prepare Site
run: |
mkdir -p ./_site/$GRAVATAR_URL;
mkdir -p ./_site/$GRAVATAR_UI_URL;
- name: Build Gravatar SDK DocC Archives
run: |
xcodebuild docbuild -scheme Gravatar-Package \
-derivedDataPath /tmp/docbuild \
-destination 'generic/platform=iOS' \
-skipPackagePluginValidation;
- name: Process Gravatar DocC
run: |
$(xcrun --find docc) process-archive \
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/Gravatar.doccarchive \
--hosting-base-path /Gravatar-SDK-iOS/$GRAVATAR_URL \
--output-path ./_site/$GRAVATAR_URL;
echo "<script>window.location.href += \"documentation/gravatar\"</script>" > ./_site/$GRAVATAR_URL/index.html;
- name: Process GravatarUI DocC
run: |
$(xcrun --find docc) process-archive \
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/GravatarUI.doccarchive \
--hosting-base-path /Gravatar-SDK-iOS/$GRAVATAR_UI_URL \
--output-path ./_site/$GRAVATAR_UI_URL;
echo "<script>window.location.href += \"documentation/gravatarui\"</script>" > ./_site/$GRAVATAR_UI_URL/index.html;
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload only docs directory
path: '_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4