Skip to content

Commit

Permalink
ci: add gh-pages ci (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
NotEvenANeko authored Dec 5, 2023
1 parent 5f69581 commit 828992d
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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 ./AVOS/Sources/Foundation/UserAgent.h | sed 's/^#define SDK_VERSION @"\(.*\)"$/\1/' | xargs)" >> "$GITHUB_ENV"
- name: Build docs
env:
REPO_URL: "${{ github.server_url }}/${{ github.repository }}"
run: >-
jazzy
--objc
--output ./apidocs
--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 }}"
--umbrella-header ./AVOS/LeanCloudObjc/LeanCloudObjc.h
--framework-root ./AVOS
--sdk iphonesimulator
- 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 828992d

Please sign in to comment.