Skip to content

Fix automatic building of documentation #4

Fix automatic building of documentation

Fix automatic building of documentation #4

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_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${REPOSITORY}.git"
HEAD:docs \
--force