Skip to content

Commit

Permalink
feat: LC 文档
Browse files Browse the repository at this point in the history
  • Loading branch information
huangliling committed Aug 28, 2024
1 parent 88287cf commit de57416
Show file tree
Hide file tree
Showing 1,014 changed files with 118,407 additions and 57 deletions.
Binary file added .contributing/img/authorize-github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/ci-failed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/ci-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/compare-changes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/download-full-content.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/fetch-and-merge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/forked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/git-commit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/git-stage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/github-dev-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/github-fork.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/github-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/mdx-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/new-pull-request.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/open-a-pr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/split-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .contributing/img/vscode-auth-github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions .github/workflows/preview-deletion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Delete Preview Environment

on:
pull_request:
types: [closed]

env:
REGION: cn-n1 # set this to your LeanCloud region, e.g. cn-n1
APP_ID: j1sU6A4GIEiCzwDu5l9Klk03-9Nh9j0Va # set this to your App ID on LeanCloud
GROUP: web # set this to your group, e.g. web

jobs:
delete-preview-environment:
runs-on: ubuntu-latest
permissions:
deployments: write
steps:
- name: Install lean-cli
run: |
sudo curl -L -o /bin/lean https://github.com/leancloud/lean-cli/releases/download/v1.2.3/lean-linux-x64
sudo chmod +x /bin/lean
- name: Delete Preview Environment
run: |
lean login --region ${{ env.REGION }} --token ${{ secrets.LC_ACCESS_TOKEN }}
lean switch --region ${{ env.REGION }} --group ${{ env.GROUP }} ${{ env.APP_ID }}
lean preview delete
- uses: strumwolf/delete-deployment-environment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: preview/${{ github.head_ref }}
onlyDeactivateDeployments: true
29 changes: 29 additions & 0 deletions .github/workflows/preview-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy Preview Environment

on:
pull_request:
types: [opened, synchronize]

env:
REGION: cn-n1 # set this to your LeanCloud region, e.g. cn-n1
APP_ID: j1sU6A4GIEiCzwDu5l9Klk03-9Nh9j0Va # set this to your App ID on LeanCloud
GROUP: web # set this to your group, e.g. web

jobs:
deploy-preview-environment:
runs-on: ubuntu-latest
environment:
name: preview/${{ github.head_ref }}
url: ${{ env.PREVIEW_URL }}
steps:
- uses: actions/checkout@v3
- name: Install lean-cli
run: |
sudo curl -L -o /bin/lean https://github.com/leancloud/lean-cli/releases/download/v1.2.3/lean-linux-x64
sudo chmod +x /bin/lean
- name: Deploy
run: |
lean login --region ${{ env.REGION }} --token ${{ secrets.LC_ACCESS_TOKEN }}
lean switch --region ${{ env.REGION }} --group ${{ env.GROUP }} ${{ env.APP_ID }}
PREVIEW_URL=$(lean preview deploy)
echo "PREVIEW_URL=$PREVIEW_URL" >> $GITHUB_ENV
17 changes: 17 additions & 0 deletions .github/workflows/prod-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Controls when the action will run. Triggers the workflow on push request for the master branch
on:
push:
branches: [master]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.CHECKOUT_TOKEN }}
- name: Deploy to LeanEngine
uses: enflo/[email protected]
with:
curl: -X POST https://console-api.cn-n1.lcops.cn/1.1/engine/groups/web/production/version?gitTag=${{ github.sha }}&token=${{ secrets.LC_DEPLOY_TOKEN }}
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Dependencies
/node_modules
package-lock.json

# Production
/build
/build-cn
/build-hk
/build-leancloud

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# IDE
/.idea/
/.vscode/
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmmirror.com
disturl=https://npmmirror.com/mirrors/node
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.8.0
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading

0 comments on commit de57416

Please sign in to comment.