Skip to content

SB-292 (Feat) : 결함 모듈 배포 #42

SB-292 (Feat) : 결함 모듈 배포

SB-292 (Feat) : 결함 모듈 배포 #42

Workflow file for this run

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 docker-compose.yml
run: echo "${{ secrets.DOCKER_COMPOSE }}" > docker-compose.yml
- name: Make Gateway application.yml
run: |
cd ./gateway/src/main/resources
echo "${{ secrets.GATEWAY_APPLICATION }}" > application.yml
- name: Make Users application.yml
run: |
cd ./users/src/main/resources
echo "${{ secrets.USER_APPLICATION }}" > application.yml
- name: Make Image application.yml
run: |
cd ./image/src/main/resources
echo "${{ secrets.IMAGE_APPLICATION }}" > application.yml
- name: Make Fault application.yml
run: |
cd ./fault/src/main/resources
echo "${{ secrets.FAULT_APPLICATION }}" > application.yml
- name: Make Warehouse application.yml
run: |
cd ./warehouse/src/main/resources
echo "${{ secrets.WAREHOUSE_APPLICATION }}" > application.yml
- name: Make Delivery application.yml
run: |
cd ./delivery/src/main/resources
echo "${{ secrets.DELIVERY_APPLICATION }}" > application.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