Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Chenmo1212 committed Apr 1, 2024
1 parent 9feebce commit 4dfea2a
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflow/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: FIKA Reading Deployment
run-name: ${{ github.actor }} is deploying ${{ github.repository }} 🚀
on:
pull_request:
branches:
- main
types:
- closed
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Check_out-code 🔎
uses: actions/checkout@v2

- name: Step 2 - Deploy to Server 🖥️
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
ARGS: "-rltgoDzvO"
SOURCE: "/"
REMOTE_HOST: ${{ vars.REMOTE_HOST }}
REMOTE_USER: 'root'
TARGET: ${{ vars.TARGET }}

- name: SSH into Server and Start Flask App
uses: appleboy/ssh-action@master
with:
host: ${{ vars.REMOTE_HOST }}
username: root
key: ${{ secrets.PRIVATE_KEY }}
port: 22
script: |
# Use the lsof command to find the process occupying port 3002
PID=$(lsof -t -i :3002)
# # If the process is found, kill it
# if [ -n "$PID" ]; then
# kill -9 $PID
# fi
#
# cd ${{ vars.TARGET }}
# npm install
# npm run build
# nohup npm start > ai_resume.log 2>&1 &

0 comments on commit 4dfea2a

Please sign in to comment.