From 0c1bc53ae0163b43a85775e597fb04d13a91361b Mon Sep 17 00:00:00 2001 From: FairyEver <1711467488@qq.com> Date: Thu, 12 Dec 2019 09:05:42 +0800 Subject: [PATCH] update Deploy Former-commit-id: d74ee410ef6ef70790bb47af3f4b74bf4bcf050e Former-commit-id: 5e71c5308ef26de9067842529110176d8a735951 Former-commit-id: fcb28d74dbef6465410cbfd1bbf7d09fcbcdf39c Former-commit-id: b1f486b481a52e0a3b3ce31bdcdcee0b1ec3fedc [formerly ff9b45275641d328be8b117ac5f32974d75fb1e0] Former-commit-id: 2bd2e55eaa11aa693a1518545f955ea9ae822a48 Former-commit-id: 372398dff6520b20088130a92937d13dd362eba9 Former-commit-id: c480851e178cb5fffb32a9a83e4b6c5779a0e345 Former-commit-id: 2712b086fa3a58253b2d65ff4b524a9b03a2b990 Former-commit-id: 5ef66de17503beb42e314ed36633f3c2b5e773ae --- .github/workflows/deploy.yml | 48 +++++++++++------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e0bbf75c..db1b439b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,50 +1,30 @@ -name: Build and upload to qiniu CDN +name: Deploy on: push: branches: - master -env: - SITE: https://fairyever.com/ - QINIU_BUCKET: fairyever-site - DIST_FOLDER: /dist - PATH_SUFFIX: /preview - jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: '10.x' - - name: Download qshell - run: | - wget http://devtools.qiniu.com/qshell-linux-x86-v2.4.0.zip - unzip qshell-linux-x86-v2.4.0.zip - mv qshell-linux-x86-v2.4.0 qshell - - name: Install packages - run: npm i - name: Build - run: npm run build:github - - name: CDN login - run: ./qshell account ${{ secrets.AK }} ${{ secrets.SK }} GITHUB_ACTION - - name: CDN upload run: | - REPO=${GITHUB_REPOSITORY//*\//} - REFRESH_URL=$SITE$REPO$PATH_SUFFIX/ - echo $REFRESH_URL > cdnrefresh.txt - ./qshell qupload2\ - --src-dir=$GITHUB_WORKSPACE$DIST_FOLDER\ - --bucket=$QINIU_BUCKET\ - --key-prefix=$REPO$PATH_SUFFIX/\ - --overwrite=true\ - --check-exists=true\ - --check-hash=true\ - --check-size=true\ - --rescan-local=true - - name: CDN refresh - run: ./qshell cdnrefresh --dirs -i ./cdnrefresh.txt \ No newline at end of file + npm install + npm run build:github + - name: Deploy + uses: SamKirkland/FTP-Deploy-Action@2.0.0 + env: + FTP_SERVER: ${{ secrets.FTP_SERVER }} + FTP_USERNAME: ${{ secrets.FTP_USERNAME }} + FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }} + METHOD: sftp + PORT: ${{ secrets.FTP_PORT }} + LOCAL_DIR: dist + REMOTE_DIR: /www/${GITHUB_REPOSITORY//*\//}/preview + ARGS: --delete --verbose --parallel=100 \ No newline at end of file