From 0ea4c1461cc8d4b4ee4a101c8c13b9a537d0fb8e Mon Sep 17 00:00:00 2001 From: Savorboard Date: Wed, 9 Jun 2021 13:52:11 +0800 Subject: [PATCH] Update github action for dashbaord. --- ...ages.yml => deploy-docs-and-dashbaord.yml} | 25 +++++++++++++------ CAP.sln | 1 + 2 files changed, 18 insertions(+), 8 deletions(-) rename .github/workflows/{deploy-to-gh-pages.yml => deploy-docs-and-dashbaord.yml} (67%) diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-docs-and-dashbaord.yml similarity index 67% rename from .github/workflows/deploy-to-gh-pages.yml rename to .github/workflows/deploy-docs-and-dashbaord.yml index 2cd2ff9..58779b7 100644 --- a/.github/workflows/deploy-to-gh-pages.yml +++ b/.github/workflows/deploy-docs-and-dashbaord.yml @@ -1,4 +1,4 @@ -name: Publish docs via GitHub Pages +name: Publish docs & Build dashboard on: push: branches: @@ -8,6 +8,7 @@ jobs: runs-on: ubuntu-latest outputs: docs: ${{ steps.filter.outputs.docs }} + dashboard: ${{ steps.filter.outputs.dashboard }} steps: - name: Checkout ๐Ÿ›Ž๏ธ uses: actions/checkout@v2 @@ -22,23 +23,31 @@ jobs: - 'docs/**' dashboard: - 'src/DotNetCore.CAP.Dashboard/wwwroot/src/**' + build-dashbaord-and-push: needs: changes - if: ${{ needs.changes.outputs.dashboard == 'true' }} + if: ${{ needs.changes.outputs.dashboard == 'true' }} runs-on: ubuntu-latest + defaults: + run: + working-directory: src/DotNetCore.CAP.Dashboard/wwwroot steps: + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v2 + with: + persist-credentials: false - name: Use Node.js ๐Ÿฅฝ uses: actions/setup-node@v1 with: node-version: '14.x' - name: Install dependencies ๐Ÿงต - run: npm install - - name: Build to dist ๆž„ๅปบ ๐Ÿงจ + run: npm install + - name: Build to dist ๐Ÿงจ run: npm run build - - name: Push dist ๐Ÿš€ - run: | - git commit -am "build dashboard to dist" --author="Github Action <>" - git push + - name: Commit & Push dist changes ๐Ÿš€ + uses: actions-js/push@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} build-docs-and-deploy: needs: changes diff --git a/CAP.sln b/CAP.sln index f263d51..d81b16b 100644 --- a/CAP.sln +++ b/CAP.sln @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .gitignore = .gitignore .travis.yml = .travis.yml appveyor.yml = appveyor.yml + .github\workflows\deploy-docs-and-dashbaord.yml = .github\workflows\deploy-docs-and-dashbaord.yml .github\ISSUE_TEMPLATE = .github\ISSUE_TEMPLATE LICENSE.txt = LICENSE.txt README.md = README.md