Added workflow for creating documentation pages #2
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: Update documentation | |
on: | |
push: | |
branches: [ "DocumentationPages" ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Generate the DocC Documentation for this project | |
runs-on: macos-14 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
- name: Update local branch | |
run: | | |
git fetch origin main | |
git reset --hard origin/main | |
- name: Build documentation | |
env: | |
scheme: ${{ 'default' }} | |
run: | | |
xcodebuild docbuild -scheme TibberSwift -destination 'generic/platform=ios' -derivedDataPath '.documentationArchive/' | |
- name: Create web folder | |
run: | | |
$(xcrun --find docc) process-archive \ | |
transform-for-static-hosting .documentationArchive/Build/Products/Debug-iphoneos/DoccFramework.doccarchive \ | |
--output-path docs \ | |
--hosting-base-path TibberSwift | |
- name: Commit changes | |
run: | | |
git add docs | |
git commit -m "Updated the documentation" | |
- name: Push changes | |
run: | | |
git push --force |