Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: try fix docs #22

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 30 additions & 19 deletions .github/workflows/docc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand All @@ -16,30 +17,40 @@ concurrency:
group: "pages"
cancel-in-progress: true

# Declare the jobs map, and start with the build job.
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
build:
# Because the script relies on xcrun and Xcode, you’ll need a macOS runner. When using DocC as a Swift package plugin, you can use a Linux machine instead.
runs-on: macos-13
# One or more steps make up a job. Declare the list of steps, and start by checking out the repository taking only the last commit. Therefore, the fetch-depth option is set to 0.
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Build All DocC 🛠
run: |
swift package resolve;
xcodebuild docbuild -scheme fs-app-health-checks -derivedDataPath /tmp/docbuild -destination 'generic/platform=iOS';
$(xcrun --find docc) process-archive \
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/AppHealthChecks.doccarchive \
--output-path docs \
--hosting-base-path apphealthchecks;
echo "<script>window.location.href += \"/documentation/apphealthchecks\"</script>" > docs/index.html;

- name: Upload artifact 📜
with:
fetch-depth: 0
# After checking out the repository, run the build-docc.sh script.
- name: Run Build Docs
run: ./build-docc.sh
# Use the actions that GitHub provides: one for configuring pages and another for uploading the contents that the script will generate and place under .docs.
# Notice how this is the same directory you set in the last line.
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload docs directory
path: 'docs'
- name: Deploy to GitHub Pages 🐙
path: .docs
# Define the deploy job.
deploy:
# Because Xcode isn’t necessary anymore, you can choose a Linux runner.
runs-on: ubuntu-latest
# The previous job, build, created and uploaded the artifacts. So, add a dependency on that job, meaning that this one will only run when the first has finished.
needs: build
# Declare a single step for this job based on the official actions/deploy-pages Action. Set the environment variables it requires.
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v2
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Loading