Skip to content

Commit

Permalink
Initial version of docc2ghpages
Browse files Browse the repository at this point in the history
  • Loading branch information
PSchmiedmayer committed Nov 3, 2021
0 parents commit c1872bc
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Paul Schmiedmayer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# docc2ghpages

Generates a DocC documentation, creates static HTML pages using docc2html, and deploys it to the gh-pagges branch

## Usage

<!-- start usage -->
```yaml
- uses: DoccZz/docc2html@v2
with:
# The name of the scheme that the documentation should be generated for passed to xcodebuild.
scheme: ''

# The personal access token (PAT) used to push to the gh-pages branch.
#
# Default: ${{ github.token }}
token: ''

# The destination the schme can be build for passed to xcodebuild.
#
# Default: platform=macOS
destination: ''
```
<!-- end usage -->
## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)
40 changes: 40 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'docc2ghpages'
description: 'Generates a DocC documentation, creates static HTML pages using docc2html, and deploys it to the gh-pagges branch'
inputs:
scheme:
description: 'The name of the scheme that the documentation should be generated for passed to xcodebuild'
required: true
token:
description: 'The personal access token (PAT) used to push to the gh-pages branch.'
required: true
default: ${{ github.token }}
destination:
description: 'The destination the schme can be build for passed to xcodebuild.'
required: true
default: 'platform=macOS'
runs:
using: "composite"
steps:
- uses: maxim-lobanov/setup-xcode@v1.2.3
with:
xcode-version: latest
- run: xcodebuild -version
shell: bash
- run: swift --version
shell: bash
- run: |
xcodebuild docbuild -scheme ${{ inputs.scheme }} -destination ${{ inputs.destination }} -derivedDataPath ./.xcodebuild
cp -r $(find ./.xcodebuild -type d -name '${{ inputs.scheme }}.doccarchive') ./${{ inputs.scheme }}.doccarchive
echo "The DocC archive can be found at ./${{ inputs.scheme }}.doccarchive"
shell: bash
- run: |
git clone https://github.com/DoccZz/docc2html.git
cd docc2html
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
swift run docc2html ../${{ inputs.scheme }}.doccarchive ../docs
shell: bash
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ inputs.token }}
publish_dir: ./docs
force_orphan: true

0 comments on commit c1872bc

Please sign in to comment.