diff --git a/.github/workflows/de.yml b/.github/workflows/de.yml index 9ff229d..31c3426 100644 --- a/.github/workflows/de.yml +++ b/.github/workflows/de.yml @@ -6,21 +6,33 @@ on: jobs: build-and-deploy: runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@master - - name: Build and Deploy - uses: JamesIves/github-pages-deploy-action@releases/v2 - env: - ACCESS_TOKEN: ${{ secrets.MY_DEPLOY_KEY }} - BASE_BRANCH: master # The branch the action should deploy from. - BRANCH: release # The branch the action should deploy to. - FOLDER: dist # The folder the action should deploy. - BUILD_SCRIPT: yarn && yarn build - - name: Deploy - uses: appleboy/ssh-action@master # 使用ssh链接服务器 - with: + strategy: + matrix: + node-version: [10.x] + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 12.19.0 + uses: actions/setup-node@v1 + with: + node-version: 12.19.0 + - name: yarn install, build + run: | + yarn + yarn build + - name: Release Github Pages + uses: igolopolosov/github-action-release-github-pages@master + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.MY_DEPLOY_KEY }} + GITHUB_PAGES_REPO_AUTHOR: ibwei + GITHUB_PAGES_REPO_NAME: ibwei.github.io + GITHUB_PAGES_RELEASE_BRANCH: master + PROJECT_BUILD_FOLDER: dist + GITHUB_PAGES_CLEANUP_SCRIPT: "rm bundle* && rm index.html" + - name: Deploy + uses: appleboy/ssh-action@master # 使用ssh链接服务器 + with: host: ${{ secrets.HOST }} username: ${{ secrets.USERNAME }} password: ${{ secrets.PASSWORD }} @@ -29,6 +41,6 @@ jobs: rm -rf /data/www/temp mkdir /data/www/temp cd /data/www/temp - git clone -b release https://github.com/ibwei/vue3-base/ + git clone -b gh-pages https://github.com/ibwei/vue3-base/ cd /data/www/temp/vue3-base mv dist/* /data/www/vue3