Skip to content

Commit

Permalink
SB-28 (Feat) : Create gradle.yml
Browse files Browse the repository at this point in the history
SB-28 (Feat) : Create gradle.yml

์ž๋™ ๋ฐฐํฌ๋ฅผ ์œ„ํ•œ gradle.yml ์ถ”๊ฐ€
  • Loading branch information
Jyuung committed Jul 12, 2024
1 parent 7e21c32 commit 96a5cc5
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Java CI with Gradle

on:
push:
branches: [ release ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Make application.yml
run: |
cd ./warehouse/src/main/resources
echo "${{ secrets.APPLICATION }}" > application.yml
- name: Make docker-compose.yml
run: |
cd ./
echo "${{ secrets.DOCKER_COMPOSE }}" > docker-compose.yml
- name: Build with Gradle
run: ./gradlew build

- name: Build and push Docker images
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
docker-compose -f docker-compose.yml build
docker-compose -f docker-compose.yml push
- name: Deploy to Server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /home/${{ secrets.SERVER_USERNAME }}/Baobab-SERVER
docker-compose down
docker-compose pull
docker-compose up -d

0 comments on commit 96a5cc5

Please sign in to comment.