调整样式 #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy | |
on: | |
push: | |
tags: | |
- "v**" | |
# branches: | |
# - 'main' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run Web | |
run: | | |
node -v | |
npm install -g pnpm | |
pnpm i | |
npm run build | |
- name: Setup SSH agent | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Add SSH key to known hosts | |
run: | | |
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts | |
- name: Package | |
run: | | |
cd build | |
tar -zcvf build.tar.gz * | |
- name: Deploy | |
run: | | |
scp -r build/build.tar.gz ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.SSH_PATH }} | |
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "tar -zxvf ${{secrets.SSH_PATH}}/build.tar.gz -C ${{secrets.SSH_PATH}}" |