Skip to content

Commit

Permalink
[Create] CI/CD 파일
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyunio authored May 9, 2024
1 parent 3043ebe commit bcb98da
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI/CD

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Set Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Run build with Gradle Wrapper
run: ./gradlew build

- name: Send file to the server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.SSH_PORT }}
source: "./build/libs/*.jar"
target: download

- name: Deploy remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script_stop: true
script: |
sh deploy/deploy.sh

0 comments on commit bcb98da

Please sign in to comment.