Skip to content

Commit

Permalink
fix: CD Workflow 수정 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
TaeyeonRoyce committed Jan 23, 2024
1 parent ac28628 commit ad80c25
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Deploy to production

on:
workflow_dispatch:
push:
branches: [ develop, main ]
branches:
- develop
- main

jobs:
build-docker-image-and-push:
Expand All @@ -11,7 +14,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.SUBMODULE_SCOPED_TOKEN }}
token: ${{ secrets.SUBMODULE_TOKEN }}
submodules: true

- name: Setup JDK 17
Expand Down Expand Up @@ -39,7 +42,6 @@ jobs:
context: .
push: true
file: ./Dockerfile
platforms: linux/arm64
tags: ${{ secrets.DOCKER_HUB_REPOSITORY }}:prod

deployment:
Expand All @@ -53,5 +55,8 @@ jobs:
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.AWS_SSH_KEY }}
script: |
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
cd api/bin/
sudo docker compose down
sudo docker compose -f /home/ubuntu/api/bin/docker-compose.yml up -d
sudo docker compose up -d
sudo docker image prune -af
File renamed without changes.

0 comments on commit ad80c25

Please sign in to comment.