feat(devops): automatic deploy front-end [v1]
This commit is contained in:
parent
d682a46f69
commit
8196020a24
31
.github/github-actions-ec2.yml
vendored
Normal file
31
.github/github-actions-ec2.yml
vendored
Normal 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
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user