-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docc static site GitHub Pages deployment action (#89)
* Skip the index fixing step * Explicitly set the hosting base path * Remove duplicate docc archiving scripts * Add step to swap index.html * Index file cleanup * Copy theme-settings file * Limit deployments to main branch pushes * Make script reusable * Add link to guide * Limit pages deployments to main pushes
- Loading branch information
1 parent
16bcfe2
commit 4dd9c5a
Showing
10 changed files
with
96 additions
and
159 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Docc Static Site Deployment | ||
on: | ||
push: | ||
branches: ["main"] | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
jobs: | ||
deploy-docs: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: sersoft-gmbh/swifty-docs-action@v2 | ||
with: | ||
output: docs | ||
use-xcodebuild: true | ||
xcodebuild-scheme: MuxUploadSDK | ||
xcodebuild-destination: generic/platform=iOS | ||
transform-for-static-hosting: true | ||
hosting-base-path: swift-upload-sdk | ||
- name: Post Process Docc Archive | ||
run: ./scripts/post-process-docc-archive-for-github-pages.sh swift-upload-sdk muxuploadsdk | ||
- uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: docs | ||
- uses: actions/[email protected] | ||
id: deployment |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<!-- This file is intended to replace the automatically generated index.html so it redirects to the "real" homepage for __SLUG__ docs --> | ||
<title>Redirecting to __SLUG__ homepage</title> | ||
<meta http-equiv="refresh" content="0; URL=/__SLUG__/documentation/__TARGET__/"> | ||
<link rel="canonical" href="/__SLUG__/documentation/__TARGET__/"/> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
if [ -z $1 ] | ||
then | ||
echo -e "\033[1;31m ERROR: this script requires a repository name parameter. \033[0m" | ||
exit $E_MISSING_POS_PARAM | ||
fi | ||
|
||
if [ -z $2 ] | ||
then | ||
echo -e "\033[1;31m ERROR: this script requires a target name parameter. \033[0m" | ||
exit $E_MISSING_POS_PARAM | ||
fi | ||
|
||
echo "▸ Adding redirect from the docc static archive root" | ||
|
||
output_path="docs" | ||
|
||
sed -e "s/__SLUG__/${1}/g" \ | ||
-e "s/__TARGET__/${2}/g" \ | ||
"scripts/docc-files/index.html.template" > ${output_path}/index.html | ||
|
||
echo "▸ Rewrote ${output_path}/index.html to:" | ||
|
||
cat ${output_path}/index.html | ||
|
||
echo "▸ Copy theme settings to static archive" | ||
|
||
cp scripts/docc-files/theme-settings.json docs |
File renamed without changes.