Merge pull request #133 from sachan13harshit/add/meta-description #69
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 React App to DigitalOcean VPS | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up SSH | |
| uses: webfactory/ssh-agent@v0.9.0 | |
| with: | |
| ssh-private-key: ${{ secrets.DIGITALOCEAN_SSH_KEY }} | |
| - name: Install dependencies and build | |
| run: | | |
| npm install | |
| npm run build | |
| - name: Clear existing files on VPS | |
| run: | | |
| ssh -o StrictHostKeyChecking=no ${{ secrets.VPS_USER }}@${{ secrets.VPS_IP }} "sudo rm -rf /var/www/DevNotes/*" | |
| - name: Copy build files to VPS | |
| run: | | |
| scp -o StrictHostKeyChecking=no -r dist/* ${{ secrets.VPS_USER }}@${{ secrets.VPS_IP }}:/var/www/DevNotes/ |