Skip to content

Commit

Permalink
perf: merge jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Storce authored Dec 27, 2024
1 parent 1652822 commit 941c474
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ on:
branches: [ "main" ]

jobs:
build:
deploy:

runs-on: ubuntu-latest

environment:
name: deployment
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -23,24 +24,8 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- uses: actions/upload-artifact@v4
with:
name: build-dist
path: dist

deploy:
needs: build
runs-on: ubuntu-latest

environment:
name: deployment

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-dist
- run: sudo apt install sshpass
- name: Sync folders
run:
sshpass -p "${{ secrets.SSH_PASSWD }}" rsync -zvr -e "ssh -o StrictHostKeyChecking=no" build-dist/ "${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:~/public_html"
- run: sudo apt install sshpass
- run: ls
- name: Sync folders
run:
sshpass -p "${{ secrets.SSH_PASSWD }}" rsync -zvr -e "ssh -o StrictHostKeyChecking=no" dist/ "${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:~/public_html"

0 comments on commit 941c474

Please sign in to comment.