Changed deploy to send backend
Some checks failed
Build and Deploy Nuxt / build (push) Failing after 1m46s
Some checks failed
Build and Deploy Nuxt / build (push) Failing after 1m46s
This commit is contained in:
@@ -41,11 +41,26 @@ jobs:
|
|||||||
- name: Compress build
|
- name: Compress build
|
||||||
run: tar -czf build.tar.gz .output
|
run: tar -czf build.tar.gz .output
|
||||||
|
|
||||||
- name: Deploy to server
|
- name: Deploy frontend to server
|
||||||
run: |
|
run: |
|
||||||
scp build.tar.gz deploy@${{ secrets.DEPLOY_HOST }}:/tmp/
|
scp build.tar.gz deploy@${{ secrets.DEPLOY_HOST }}:/tmp/
|
||||||
ssh deploy@${{ secrets.DEPLOY_HOST }} << 'EOF'
|
ssh deploy@${{ secrets.DEPLOY_HOST }} << 'EOF'
|
||||||
rm -rf /var/www/app/.output
|
rm -rf /var/www/app/.output
|
||||||
tar -xzf /tmp/build.tar.gz -C /var/www/app
|
tar -xzf /tmp/build.tar.gz -C /var/www/app
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Compress backend and deploy
|
||||||
|
working-directory: ./
|
||||||
|
run: |
|
||||||
|
tar -czf backend.tar.gz backend
|
||||||
|
scp backend.tar.gz deploy@{{ secrets.DEPLOY_HOST }}:/tmp/
|
||||||
|
ssh deploy@{{ secrets.DEPLOY_HOST }} << 'EOF'
|
||||||
|
rm -rf /var/www/app/backend
|
||||||
|
tar -xzf /tmp/backend.tar.gz -C /var/www/app
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Restart server
|
||||||
|
run: |
|
||||||
|
ssh deploy@${{ secrets.DEPLOY_HOST }} << 'EOF'
|
||||||
sudo systemctl restart app
|
sudo systemctl restart app
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user