From 6d5ba96281978b1d9f1a6647591c23a89a1fe95e Mon Sep 17 00:00:00 2001 From: yanglbme Date: Sat, 2 May 2020 20:31:24 +0800 Subject: [PATCH] fix: update build.yml --- .github/workflows/build.yml | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a1a3ce..b2954be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,19 +1,24 @@ -name: build - +name: Build and Deploy on: push: - branches: [ master ] - + branches: [ master ] jobs: - build: + build-and-deploy: runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@master # 将代码拷贝到虚机中 - - name: npm install, build - uses: JamesIves/github-pages-deploy-action@master - env: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret - BRANCH: gh-page # 存放产物的分支名称 - FOLDER: dist # 存放build后产物的目录 - BUILD_SCRIPT: npm install && npm run build # 执行的命令 \ No newline at end of file + - name: Checkout + uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Install and Build + run: | + npm install + npm run build + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BRANCH: gh-pages + FOLDER: dist