feat(devops): automatic deploy front-end [v1]

This commit is contained in:
Leandro Antônio Farias Machado 2023-05-15 10:39:43 -03:00 committed by GitHub
parent d682a46f69
commit 8196020a24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

31
.github/github-actions-ec2.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Deploy Project
# Trigger deployment only on push to master branch
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy Front-End
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy to EC2 instance
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_DNS }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
cd ~/oktopus/frontend
git pull origin master
yarn install &&
yarn build &&
pm2 restart oktopus