Skip to content

ci: add gh-pages ci (#444) #1

ci: add gh-pages ci (#444)

ci: add gh-pages ci (#444) #1

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
deploy:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo gem install jazzy
brew bundle
bundle install
- name: Set version env var
run: |
echo "CURRENT_VERSION=$(cat .version | xargs)" >> "$GITHUB_ENV"
- name: Build docs
env:
REPO_URL: "${{ github.server_url }}/${{ github.repository }}"
run: >-
jazzy
--output ./apidocs
--build-tool-arguments
-project,./LeanCloud.xcodeproj,-scheme,LeanCloud,-configuration,Release
--author LeanCloud
--author_url https://leancloud.cn
--module LeanCloud
--module-version $CURRENT_VERSION
--github_url $REPO_URL
--github-file-prefix "${REPO_URL}/tree/${CURRENT_VERSION}"
--root-url "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}"
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: apidocs
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"