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

GitHub Actions to build and deploy docc documentations #69

Merged
merged 15 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 13 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
46 changes: 46 additions & 0 deletions .github/workflows/docc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy Documentation
on:
push:
branches: [main, dev]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: macos-13
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be 1 as you do not need the whole history

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do? I haven't looked at it in-depth yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 would get all the git history, brackens and tags. Default is 1 where it will fetch only the intended branch.

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "15.0.0"
- name: Setup Config file
run: |
cp Basic-Car-Maintenance.xcconfig.template Basic-Car-Maintenance.xcconfig
- name: Run Build Docs
run: ./build-docc.sh
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: .docs
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
3 changes: 2 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
- Source/ExcludedFolder
- Source/ExcludedFile.swift
- Source/*/ExcludedFile.swift # Exclude files with a wildcard
- Source/*/ExcludedFile.swift
- .derivedData # Exclude files with a wildcard
analyzer_rules: # Rules run by `swiftlint analyze` (experimental)
- explicit_self

Expand Down
4 changes: 2 additions & 2 deletions Basic-Car-Maintenance.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.icyappstudio.Basic-Car-Maintenance.Basic-Car-Maintenance-Widget";
PRODUCT_BUNDLE_IDENTIFIER = "com.icyappstudio.app.Basic-Car-Maintenance.Basic-Car-Maintenance-Widget";
mikaelacaron marked this conversation as resolved.
Show resolved Hide resolved
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -914,7 +914,7 @@
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.icyappstudio.Basic-Car-Maintenance.Basic-Car-Maintenance-Widget";
PRODUCT_BUNDLE_IDENTIFIER = "com.icyappstudio.app.Basic-Car-Maintenance.Basic-Car-Maintenance-Widget";
mikaelacaron marked this conversation as resolved.
Show resolved Hide resolved
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
Expand Down
15 changes: 15 additions & 0 deletions build-docc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
##!/bin/sh

xcrun xcodebuild docbuild \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be nice to move this into a subfolder like tools so tat it is "hidden" for those who don't need to know about it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about folder named scripts?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think .scripts would work (so it's a hidden folder by default

-scheme Basic-Car-Maintenance \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath "$PWD/.derivedData"

xcrun docc process-archive transform-for-static-hosting \
"$PWD/.derivedData/Build/Products/Debug-iphonesimulator/Basic-Car-Maintenance.doccarchive" \
--output-path ".docs" \
--hosting-base-path "Basic-Car-Maintenance"

echo '<script>window.location.href += "documentation/basic_car_maintenance"</script>' > .docs/index.html