Revert: Stop overwriting the root index.html #163
Workflow file for this run
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 your workflow. | |
name: Deploy Gravatar DocC | |
on: | |
# Runs on pushes and PRs targeting the default branch | |
push: | |
branches: [ "andrewdmontgomery/fix-swiftpackageindex-docs" ] | |
# 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@v3 | |
- name: Switch Xcode 🔄 | |
run: sudo xcode-select --switch /Applications/Xcode_15.4.app | |
- name: Build Gravatar DocC | |
run: | | |
xcodebuild docbuild -scheme Gravatar \ | |
-derivedDataPath /tmp/docbuild \ | |
-destination 'generic/platform=iOS'; | |
$(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 gravatar-docs; | |
echo "<script>window.location.href += \"documentation/gravatar\"</script>" > gravatar-docs/index.html; | |
- name: Build GravatarUI DocC | |
run: | | |
xcodebuild docbuild -scheme GravatarUI \ | |
-derivedDataPath /tmp/docbuild \ | |
-destination 'generic/platform=iOS'; | |
$(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 gravatar-ui-docs; | |
echo "<script>window.location.href += \"documentation/gravatarui\"</script>" > gravatar-ui-docs/index.html; | |
- name: Move generated docs to branch directory | |
run: | | |
mkdir -p ./_site/$GRAVATAR_URL && mv ./gravatar-docs/* ./_site/$GRAVATAR_URL/; | |
mkdir -p ./_site/$GRAVATAR_UI_URL && mv ./gravatar-ui-docs/* ./_site/$GRAVATAR_UI_URL/; | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload only docs directory | |
path: '_site' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |