Skip to content

Commit

Permalink
Use git pull instead of copying for CD (#97)
Browse files Browse the repository at this point in the history
* fix path error in deployment yaml

* fix path error in deployment yaml

* fix copying command

* use git pull instead of rote copying

---------

Co-authored-by: arminpatel <[email protected]>
  • Loading branch information
theoden42 and arminpatel authored Nov 10, 2024
1 parent 214b50c commit 45b8347
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_VCM }}

- name: Copy new changes
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.VCM_HOST_USERNAME }}@${{ secrets.VCM_HOST_DNS }} 'rm -rf ${{ secrets.VCM_FRONTEND_DIR }}/*'
scp -o StrictHostKeyChecking=no -r ./* "${{ secrets.VCM_HOST_USERNAME}}@${{ secrets.VCM_HOST_DNS }}:${{ secrets.VCM_FROTEND_DIR }}/"
- name: Pull New Changes
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.VCM_HOST_USERNAME }}@${{ secrets.VCM_HOST_DNS }} 'sudo cd ${{secrets.VCM_FRONTEND_DIR}}
&& sudo git pull origin main'
- name: Build the changes and deploy
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.VCM_HOST_USERNAME }}@${{ secrets.VCM_HOST_DNS }} << EOF
sudo cd ${{ secrets.VCM_FRONTEND_DIR }}
sudo npm install
sudo npm install --legacy-peer-deps
sudo npm run build
sudo rm -rf /var/www/*
sudo cp -r dist/* /var/www/
Expand Down

0 comments on commit 45b8347

Please sign in to comment.