Skip to content

Commit

Permalink
Update ci.cd.prod.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
oU-Ua authored Jul 12, 2024
1 parent 08a73ae commit 0fda8fd
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/ci.cd.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ jobs:
#arguments: build
run : ./gradlew clean build --exclude-task test

- name: Copy files via SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_KEY }}
source: "build/libs/*.jar"
target: "/home/ec2-user/app/"
- name: Build and deploy
run: |
echo "$SSH_PEM_KEY" >> $HOME/key.pem
chmod 400 $HOME/key.pem
ssh -i $HOME/key.pem -o StrictHostKeyChecking=no ${SSH_USER}@${SSH_KNOWN_HOSTS} '~/script.sh'
env:
SSH_USER: ${{secrets.SSH_USER}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
SSH_PEM_KEY: ${{secrets.SSH_PEM_KEY}}

- name: Execute deployment script
uses: appleboy/[email protected]
Expand Down

0 comments on commit 0fda8fd

Please sign in to comment.