Skip to content
Merged
Show file tree
Hide file tree
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
61 changes: 61 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Documentation

on:
push:
branches: [ master ]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Build Documentation
run: |
xcodebuild docbuild -scheme Animations \
-destination 'generic/platform=iOS' \
-derivedDataPath ./DerivedData

- name: Process Documentation Archive
run: |
# Find the generated .doccarchive
DOCC_ARCHIVE=$(find ./DerivedData -name "*.doccarchive" | head -n 1)

if [ -z "$DOCC_ARCHIVE" ]; then
echo "Error: No .doccarchive found"
exit 1
fi

echo "Found documentation archive: $DOCC_ARCHIVE"

# Convert to static HTML
xcrun docc process-archive transform-for-static-hosting \
"$DOCC_ARCHIVE" \
--output-path ./docs \
--hosting-base-path Animations

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
45 changes: 45 additions & 0 deletions GITHUB_PAGES_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# GitHub Pages Setup Instructions

This repository includes a GitHub Actions workflow that automatically builds and deploys documentation to GitHub Pages.

## Enabling GitHub Pages

To enable GitHub Pages for this repository, follow these steps:

1. Go to the repository on GitHub
2. Click on **Settings** (gear icon)
3. In the left sidebar, click on **Pages** (under "Code and automation")
4. Under "Build and deployment":
- **Source**: Select "GitHub Actions"
5. Save the configuration

## How it Works

The documentation workflow (`.github/workflows/documentation.yml`) automatically:

1. Triggers on every push to the `master` branch
2. Uses `xcodebuild docbuild` to generate Swift documentation from the source code
3. Converts the DocC archive to static HTML
4. Deploys the generated documentation to GitHub Pages

## Accessing the Documentation

Once the workflow completes successfully, the documentation will be available at:

https://mikelrob.github.io/Animations/documentation/animations/

## Manual Trigger

You can also manually trigger the documentation build:

1. Go to the **Actions** tab in the repository
2. Select the "Documentation" workflow
3. Click "Run workflow"
4. Select the branch (usually `master`)
5. Click "Run workflow"

## Requirements

- The workflow requires GitHub Pages to be enabled with "GitHub Actions" as the source
- The workflow uses macOS runners (required for Swift DocC tooling)
- Repository must have proper permissions set for the workflow (already configured in the workflow file)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Animations provide a small number of wrappers around UIKit that I think are nice to have when writing animation code.

[📖 View Documentation](https://mikelrob.github.io/Animations/documentation/animations/)

`Animation` is a wrapper around `UIView.animate` that provides an interface to chain animations.

The `AnimationCoordinator` provides a interface to coordinate multiple `UIViewPropertyAnimator`s alongside each other.
Loading