Skip to content

Update github-actions-demo.yml #11

Update github-actions-demo.yml

Update github-actions-demo.yml #11

name: WOWMKT server CI/CD
on:
push:
branches: [ main ]
jobs:
SSH:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: ssh to ec2
uses: appleboy/ssh-action@master
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
script: |
cd /home/ec2-user/apps/step1
sh deploy.sh
REPOSITORY=/home/ec2-user/apps/step1
JAR_NAME=$(ls -tr $REPOSITORY/ | grep jar | head -n 1)
echo "> JAR Name: $JAR_NAME"
nohup java -jar $JAR_NAME &