Skip to content

Commit

Permalink
Build docs as part of github
Browse files Browse the repository at this point in the history
  • Loading branch information
younata committed Mar 30, 2024
1 parent dfc3286 commit 1dcf756
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build Documentation
on: push

permissions:
contents: write

jobs:
build-documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build Docs
run: |
./script/build_docs.zsh
- name: Deploy Docs
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs
7 changes: 2 additions & 5 deletions script/build_docs.zsh
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#!/bin/zsh

GIT_ROOT=$(git rev-parse --show-toplevel)
pushd "${GIT_ROOT}" 2>&1 >/dev/null

export DOCC_JSON_PRETTYPRINT="YES"

mkdir -p docs

swift package --allow-writing-to-directory docs \
generate-documentation --target Nimble \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path 'https://quick.github.io/Nimble' \
--output-path docs

popd
6 changes: 1 addition & 5 deletions script/release
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,7 @@ else

git add ${PODSPEC} || { restore_podspec; die "Failed to add ${PODSPEC} to INDEX"; }

echo "--- Updating Docs ---"
./script/build_docs.zsh
git add docs || { git co docs; die "Failed to add docs to INDEX"; }

git commit -m "[$VERSION_TAG] Update docs and podspec" || { restore_podspec; die "Failed to push updated version: $VERSION"; }
git commit -m "[$VERSION_TAG] Update podspec" || { restore_podspec; die "Failed to push updated version: $VERSION"; }
fi

RELEASE_NOTES="Version ${VERSION}. Open https://github.com/Quick/Nimble/releases/tag/$VERSION_TAG for full release notes."
Expand Down

0 comments on commit 1dcf756

Please sign in to comment.