瀏覽代碼

chore: finish deploy with actions

dragooncjw 10 月之前
父節點
當前提交
5cd41e07a0
共有 2 個文件被更改,包括 4 次插入65 次删除
  1. 0 61
      .github/workflows/deploy-docs.yml
  2. 4 4
      .github/workflows/deploy.yml

+ 0 - 61
.github/workflows/deploy-docs.yml

@@ -1,61 +0,0 @@
-name: Deploy Doc Site
-on:
-  workflow_dispatch
-
-concurrency:
-  group: "gh-pages-branch-workflow" # 唯一标识符,确保只运行一个实例
-  cancel-in-progress: false     # 不取消正在运行的实例,后续触发需要等待当前实例完成
-
-jobs:
-  build:
-    runs-on: ubuntu-latest
-    permissions:
-      contents: write
-    steps:
-      - uses: actions/checkout@v3
-        with:
-          fetch-depth: 2
-      - name: Check if branch is main
-        run: |
-          if [ "$GITHUB_REF" != "refs/heads/gh-pages" ]; then
-            echo "Not on gh-pages branch, exiting workflow."
-            exit 1
-          fi
-          echo "On gh-pages branch, continuing workflow."
-      - name: Config Git User
-        run: |
-          git config --local user.name "dragooncjw"
-          git config --local user.email "289056872@qq.com"
-      - uses: actions/setup-node@v3
-        with:
-          node-version: 18
-          registry-url: 'https://registry.npmjs.org/'
-      - name: Rush Install
-        run: node common/scripts/install-run-rush.js install
-      - name: Rush build
-        run: node common/scripts/install-run-rush.js build
-      - name: Generate docs
-        run: |
-          cd apps/docs
-          npm run docs
-      - name: Copy auto-docs to en
-        run: cp -r apps/docs/src/zh/auto-docs apps/docs/src/en/auto-docs
-      - name: Build Doc site
-        run: |
-          cd apps/docs
-          npm run build
-      - name: Replace docs
-        run: |
-          rm -rf docs
-          mv apps/docs/doc_build docs
-      - name: Add CNAME
-        run: |
-          echo "flowgram.ai" > ./docs/CNAME
-      - name: Push code
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        run: |
-          git add .
-          git commit -m "chore: update docs" -n
-          git push
-

+ 4 - 4
.github/workflows/deploy.yml

@@ -3,7 +3,7 @@ on:
   workflow_dispatch
 
 concurrency:
-  group: "gh-pages-branch-workflow" # 唯一标识符,确保只运行一个实例
+  group: "main-deploy-branch-workflow" # 唯一标识符,确保只运行一个实例
   cancel-in-progress: false     # 不取消正在运行的实例,后续触发需要等待当前实例完成
 
 jobs:
@@ -19,11 +19,11 @@ jobs:
           fetch-depth: 2
       - name: Check if branch is main
         run: |
-          if [ "$GITHUB_REF" != "refs/heads/gh-pages" ]; then
-            echo "Not on gh-pages branch, exiting workflow."
+          if [ "$GITHUB_REF" != "refs/heads/main" ]; then
+            echo "Not on main branch, exiting workflow."
             exit 1
           fi
-          echo "On gh-pages branch, continuing workflow."
+          echo "On main branch, continuing workflow."
       - name: Config Git User
         run: |
           git config --local user.name "dragooncjw"