38 lines
1.0 KiB
YAML
38 lines
1.0 KiB
YAML
name: Deploy Angular via SSH
|
|
on: [push]
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node 16
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
|
|
- name: Install and Build
|
|
run: |
|
|
npm install --legacy-peer-deps
|
|
npm run build -- --prod
|
|
|
|
- name: Transferir arquivos via SCP
|
|
uses: https://github.com/appleboy/scp-action@master
|
|
with:
|
|
host: ${{ secrets.REMOTE_HOST }}
|
|
username: ${{ secrets.REMOTE_USER }}
|
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
source: "dist/"
|
|
target: "/var/www/html/vendaweb-frontend"
|
|
strip_components: 1
|
|
|
|
- name: Reiniciar Nginx Remoto
|
|
uses: https://github.com/appleboy/ssh-action@master
|
|
with:
|
|
host: ${{ secrets.REMOTE_HOST }}
|
|
username: ${{ secrets.REMOTE_USER }}
|
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
script: |
|
|
sudo systemctl reload nginx |