Skip to content

Commit

Permalink
feat: add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Lawndlwd committed Feb 24, 2024
1 parent e9d2151 commit 432364c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/deploy-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ jobs:
- name: Build React app
run: npm run build

- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Deploy to Server
run: |
ssh -i ~/.ssh/deploy_key ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}
cp -r dist/* /var/www//html
- name: Copy dist to VPS
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
port: 22
key: ${{ secrets.DEPLOY_KEY }}
source: 'dist'
target: '/var/www/html'

0 comments on commit 432364c

Please sign in to comment.