Fix automatic deploying of documentation #6
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: build-documentation | |
on: | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: | |
jobs: | |
build-docc: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Create folder for generated documentation | |
run: | | |
mkdir docs | |
- name: Build Documentation | |
run: | | |
swift package --allow-writing-to-directory docs \ | |
generate-documentation \ | |
--target OSLogViewer \ | |
--disable-indexing \ | |
--output-path docs \ | |
--transform-for-static-hosting | |
- name: Init new repo in dist folder and commit generated files | |
run: | | |
cd docs | |
git init | |
git add -A | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m 'deploy' | |
git push \ | |
"https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" \ | |
HEAD:docs \ | |
--force |