Skip to content

Commit 828992d

Browse files
authored
ci: add gh-pages ci (#700)
1 parent 5f69581 commit 828992d

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
runs-on: macos-12
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Install dependencies
18+
run: |
19+
sudo gem install jazzy
20+
brew bundle
21+
bundle install
22+
23+
- name: Set version env var
24+
run: |
25+
echo "CURRENT_VERSION=$(cat ./AVOS/Sources/Foundation/UserAgent.h | sed 's/^#define SDK_VERSION @"\(.*\)"$/\1/' | xargs)" >> "$GITHUB_ENV"
26+
27+
- name: Build docs
28+
env:
29+
REPO_URL: "${{ github.server_url }}/${{ github.repository }}"
30+
run: >-
31+
jazzy
32+
--objc
33+
--output ./apidocs
34+
--author LeanCloud
35+
--author_url https://leancloud.cn
36+
--module LeanCloud
37+
--module-version $CURRENT_VERSION
38+
--github_url $REPO_URL
39+
--github-file-prefix "${REPO_URL}/tree/${CURRENT_VERSION}"
40+
--root-url "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}"
41+
--umbrella-header ./AVOS/LeanCloudObjc/LeanCloudObjc.h
42+
--framework-root ./AVOS
43+
--sdk iphonesimulator
44+
45+
- name: Deploy to gh-pages
46+
uses: peaceiris/actions-gh-pages@v3
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
publish_dir: apidocs
50+
user_name: "github-actions[bot]"
51+
user_email: "github-actions[bot]@users.noreply.github.com"

0 commit comments

Comments
 (0)