Skip to content

Commit

Permalink
Merge pull request #152 from 2024-startup/BE/feat/#151
Browse files Browse the repository at this point in the history
[BE/feat/#151] 빌드 후, 머지시에만 배포 설정 완
  • Loading branch information
kalsteve authored May 31, 2024
2 parents 2e1cdf9 + 4ad752f commit a3668ab
Showing 1 changed file with 4 additions and 27 deletions.
31 changes: 4 additions & 27 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@
name: Deploy Spring Boot App

on:
workflow_run:
workflows: [Backend CI]
types:
- completed
push:
branches:
- dev

jobs:
deploy:
# 실행 환경 설정
runs-on: ubuntu-latest
environment: envs
# 이전 워크 플로우 성공시
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
# 저장공간 설정
Expand Down Expand Up @@ -62,24 +59,4 @@ jobs:
echo "S3_BUCKET_NAME=${{ secrets.S3_BUCKET_NAME }}" >> ./backend.env
echo "S3_ACCESS_KEY=${{ secrets.S3_ACCESS_KEY }}" >> ./backend.env
echo "S3_SECRET_KEY=${{ secrets.S3_SECRET_KEY }}" >> ./backend.env
docker-compose -f docker-compose_for_action.yml up -d

# - name: Build Docker Image
# run: |
# docker build -t your-docker-username/your-image-name:latest .
# docker login -u your-docker-username -p ${{ secrets.DOCKER_PASSWORD }}
# docker push your-docker-username/your-image-name:latest
#
# - name: Deploy to Server
# run: |
# scp build/libs/*.jar username@server_ip:/path/to/deployment/directory
# ssh username@server_ip "sudo systemctl restart your-spring-boot-service"
# env:
# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
#
# - name: Deploy Docker Compose
# run: |
# ssh username@server_ip "cd /path/to/docker-compose-directory && docker-compose up -d"
# env:
# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
docker-compose -f docker-compose_for_action.yml up -d

0 comments on commit a3668ab

Please sign in to comment.