Skip to content

Create CD-dev.yml

Create CD-dev.yml #1

Workflow file for this run

name: BabyWithUs CD
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
- name: Build with Gradle
run: ./gradlew build -Dspring.profiles.active=dev
- name: Copy files to server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
source: "build/libs/*.jar"
target: "/home/ec2-user/BabyWithUs-Back/build/libs/"
- name: SSH commands to start application
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: |
cd /home/ec2-user/BabyWithUs-Back/build/libs/
java -jar BabyWithUs-0.0.1-SNAPSHOT.jar