Skip to content

Commit

Permalink
Update frontend-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyami authored Nov 26, 2023
1 parent 0f2b5b1 commit 5cb15f0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ jobs:
cache: 'npm'
cache-dependency-path: './miaosha-h5/package-lock.json'

- name: npm install and build
run: |
npm install
npm run build
- name: npm install
run: npm install

- name: Zip files
- name: npm build
run: npm run build

- name: Zip dist.zip
run: zip -r dist.zip ./dist/**

- name: Clean up old files
run: sshpass -p "${{ secrets.SSH_PASSWORD }}" ssh -o StrictHostKeyChecking=no "${{ secrets.SSH_USERNAME }}"@"${{ secrets.SSH_HOST }}" "rm -rf ${{ secrets.DEPLOY_DIR }}/dist*"

- name: Copy file via SCP
run: sshpass -p "${{ secrets.SSH_PASSWORD }}" scp -o StrictHostKeyChecking=no dist.zip "${{ secrets.SSH_USERNAME }}"@"${{ secrets.SSH_HOST }}":"${{ secrets.DEPLOY_DIR }}"

- name: Unzip dist.zip
run: sshpass -p "${{ secrets.SSH_PASSWORD }}" ssh -o StrictHostKeyChecking=no "${{ secrets.SSH_USERNAME }}"@"${{ secrets.SSH_HOST }}" "unzip ${{ secrets.DEPLOY_DIR }}/dist.zip"

0 comments on commit 5cb15f0

Please sign in to comment.