docs: configurando deploy via ssh para angular
This commit is contained in:
38
gitea/deploy-ssh.yaml
Normal file
38
gitea/deploy-ssh.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
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
|
||||
Reference in New Issue
Block a user