Skip to content

Commit 45b8347

Browse files
Use git pull instead of copying for CD (#97)
* 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]>
1 parent 214b50c commit 45b8347

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
with:
1919
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_VCM }}
2020

21-
- name: Copy new changes
22-
run: |
23-
ssh -o StrictHostKeyChecking=no ${{ secrets.VCM_HOST_USERNAME }}@${{ secrets.VCM_HOST_DNS }} 'rm -rf ${{ secrets.VCM_FRONTEND_DIR }}/*'
24-
scp -o StrictHostKeyChecking=no -r ./* "${{ secrets.VCM_HOST_USERNAME}}@${{ secrets.VCM_HOST_DNS }}:${{ secrets.VCM_FROTEND_DIR }}/"
21+
- name: Pull New Changes
22+
run: |
23+
ssh -o StrictHostKeyChecking=no ${{ secrets.VCM_HOST_USERNAME }}@${{ secrets.VCM_HOST_DNS }} 'sudo cd ${{secrets.VCM_FRONTEND_DIR}}
24+
&& sudo git pull origin main'
2525
- name: Build the changes and deploy
2626
run: |
2727
ssh -o StrictHostKeyChecking=no ${{ secrets.VCM_HOST_USERNAME }}@${{ secrets.VCM_HOST_DNS }} << EOF
2828
sudo cd ${{ secrets.VCM_FRONTEND_DIR }}
29-
sudo npm install
29+
sudo npm install --legacy-peer-deps
3030
sudo npm run build
3131
sudo rm -rf /var/www/*
3232
sudo cp -r dist/* /var/www/

0 commit comments

Comments
 (0)