Skip to content

Commit

Permalink
docs: github actions workflow 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
y-ngm-n committed Nov 4, 2024
1 parent 0afb556 commit c292366
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions .github/workflows/backend_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,32 @@ jobs:
docker build -t ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/jumo_back_prod:latest .
docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/jumo_back_prod:latest
deploy-to-az1:
needs: build-docker-image
runs-on: [ prod, 2a ]
steps:
- name: ecr get-login-password
run: |
aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/jumo_back_prod
- name: Pull Docker image from AWS ECR
run: |
docker pull ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/jumo_back_prod:latest
- name: stop Docker system
run: sudo docker stop $(sudo docker ps -aq) || true

- name: Run new Docker container
run: |
docker run --rm -it -d -p 80:8080 --name jumo_back_prod -e SPRING_PROFILES_ACTIVE=prod ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/jumo_back_prod:latest
- name: Clean up unused Docker images after deployment
run: |
sudo docker image prune -a -f || true
# deploy-to-az1:
# needs: build-docker-image
# runs-on: [ prod, 2a ]
# steps:
#
# - name: ecr get-login-password
# run: |
# aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/jumo_back_prod
# - name: Pull Docker image from AWS ECR
# run: |
# docker pull ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/jumo_back_prod:latest
#
# - name: stop Docker system
# run: sudo docker stop $(sudo docker ps -aq) || true
#
# - name: Run new Docker container
# run: |
# docker run --rm -it -d -p 80:8080 --name jumo_back_prod -e SPRING_PROFILES_ACTIVE=prod ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/jumo_back_prod:latest
#
# - name: Clean up unused Docker images after deployment
# run: |
# sudo docker image prune -a -f || true

deploy-to-az2:
needs: deploy-to-az1
# needs: deploy-to-az1
needs: build-docker-image
runs-on: [ prod, 2c ]
steps:

Expand Down

0 comments on commit c292366

Please sign in to comment.