Quellcode durchsuchen

[Actions]Add workflow.

dufu1991 vor 3 Jahren
Ursprung
Commit
c86b3a5f8f
1 geänderte Dateien mit 54 neuen und 61 gelöschten Zeilen
  1. 54 61
      .github/workflows/build-demo.yml

+ 54 - 61
.github/workflows/build-demo.yml

@@ -9,71 +9,64 @@
 name: BUILD DEMO
 
 on:
-    push:
-        branches:
-            - main
-        paths:
-            - 'demo/**'
+  push:
+    branches:
+      - main
+    paths:
+      - 'demo/**'
 
 jobs:
-    build-and-deploy:
-        runs-on: ubuntu-latest
-        steps:
-            - name: Checkout
-              uses: actions/checkout@v2
-            - name: Setup Node.js environment
-              uses: actions/setup-node@v1
-              with:
-                  node-version: 18.x
+  build-and-deploy:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+      - name: Setup Node.js environment
+        uses: actions/setup-node@v1
+        with:
+          node-version: 18.x
 
-            - name: Setup Python environment
-              uses: actions/setup-python@v2
-              with:
-                  python-version: 3.x
-            - name: Install pip
-              run: python3 -m pip install --upgrade pip
-            - name: Install aliyun-python-sdk-cdn
-              run: python3 -m pip install aliyun-python-sdk-cdn
-            - name: Install aliyun-python-sdk-core
-              run: python3 -m pip install aliyun-python-sdk-core
-            - name: Install logging
-              run: python3 -m pip install logging
+      - name: Setup Python environment
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.x
+      - name: Install pip
+        run: python3 -m pip install --upgrade pip
+      - name: Install aliyun-python-sdk-cdn
+        run: python3 -m pip install aliyun-python-sdk-cdn
+      - name: Install aliyun-python-sdk-core
+        run: python3 -m pip install aliyun-python-sdk-core
+      - name: Install logging
+        run: python3 -m pip install logging
 
-            # cd packages/rollup-plugin-stdf-icon 目录下
-            # 安装依赖 npm install
-            # 打包 npm run build
-            - name: Build rollup-plugin-stdf-icon
-              run: |
-                  cd packages/rollup-plugin-stdf-icon
-                  npm install
-                  npm run build
+      # cd packages/rollup-plugin-stdf-icon 目录下
+      # 安装依赖 npm install
+      # 打包 npm run build
+      - name: Build rollup-plugin-stdf-icon
+        run: |
+          cd packages/rollup-plugin-stdf-icon
+          npm install
+          npm run build
 
-            # cd packages/stdf 目录下
-            # 执行 node/scripts/dist.js 脚本
-            - name: Build stdf
-              run: |
-                  cd packages/stdf
-                  node scripts/dist.js
+      - name: Install dependencies and build
+        run: |
+          cd demo
+          npm install
+          npm run build
 
-            - name: Install dependencies and build
-              run: |
-                  cd demo
-                  npm install
-                  npm run build
+      - name: Upload
+        uses: appleboy/scp-action@master
+        with:
+          host: ${{ secrets.ALIYUN_HOST }}
+          username: ${{ secrets.ALIYUN_USERNAME }}
+          port: ${{ secrets.ALIYUN_PORT }}
+          password: ${{ secrets.ALIYUN_PRIVATE_KEY }}
+          source: demo/dist/*
+          target: /usr/share/nginx/demo_stdf/
+          strip_components: 2
 
-            - name: Upload
-              uses: appleboy/scp-action@master
-              with:
-                  host: ${{ secrets.ALIYUN_HOST }}
-                  username: ${{ secrets.ALIYUN_USERNAME }}
-                  port: ${{ secrets.ALIYUN_PORT }}
-                  password: ${{ secrets.ALIYUN_PRIVATE_KEY }}
-                  source: demo/dist/*
-                  target: /usr/share/nginx/demo_stdf/
-                  strip_components: 2
-
-            - name: Refresh CDN
-              env:
-                  ALIYUN_CDN_AK: ${{ secrets.ALIYUN_CDN_AK }}
-                  ALIYUN_CDN_SK: ${{ secrets.ALIYUN_CDN_SK }}
-              run: python3 demo/Refresh-auto.py -r demo/cdn-list.txt -t clear -o Directory
+      - name: Refresh CDN
+        env:
+          ALIYUN_CDN_AK: ${{ secrets.ALIYUN_CDN_AK }}
+          ALIYUN_CDN_SK: ${{ secrets.ALIYUN_CDN_SK }}
+        run: python3 demo/Refresh-auto.py -r demo/cdn-list.txt -t clear -o Directory