Skip to content

Commit

Permalink
ci: add gh-pages ci (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
NotEvenANeko authored Dec 5, 2023
1 parent 15956e3 commit 472784c
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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"

0 comments on commit 472784c

Please sign in to comment.