Skip to content

Commit

Permalink
feat: 프로필 prod로 롤백 + 태그기반 배포
Browse files Browse the repository at this point in the history
  • Loading branch information
pminsung12 committed Aug 3, 2024
1 parent 3666dd6 commit 51957ff
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/manual-prod-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
name: Manual Production Deployment

on:
push:
branches:
- release
# workflow_dispatch:
# inputs:
# tag:
# description: 'Tag to deploy (v0.33.8)'
# required: true
workflow_dispatch:
inputs:
tag:
description: 'Tag to deploy (v0.33.8)'
required: true

jobs:
deploy-to-prod:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# with:
# ref: ${{ github.event.inputs.tag }}
with:
ref: ${{ github.event.inputs.tag }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -33,7 +30,7 @@ jobs:
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/spot-server:prod-${{ github.sha }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/spot-server:prod-${{ github.event.inputs.tag }}

- name: Deploy to PROD - AWS EC2
uses: appleboy/ssh-action@master
Expand All @@ -48,7 +45,7 @@ jobs:
docker rm spot-server-prod || true
docker run -d --name spot-server-prod \
-p 8080:8080 \
-e SPRING_PROFILES_ACTIVE=dev \
-e SPRING_PROFILES_ACTIVE=prod \
-e SPRING_DATASOURCE_URL=${{ secrets.PROD_DB_URL }} \
-e SPRING_DATASOURCE_USERNAME=${{ secrets.PROD_DB_USERNAME }} \
-e SPRING_DATASOURCE_PASSWORD=${{ secrets.PROD_DB_PASSWORD }} \
Expand All @@ -63,5 +60,5 @@ jobs:
-e SENTRY_DSN=${{ secrets.SENTRY_DSN }} \
-e SENTRY_ENABLE_TRACING=true \
-e SENTRY_ENVIRONMENT=prod \
${{ secrets.DOCKERHUB_USERNAME }}/spot-server:prod-${{ github.sha }}
${{ secrets.DOCKERHUB_USERNAME }}/spot-server:prod-${{ github.event.inputs.tag }}
docker system prune -af

0 comments on commit 51957ff

Please sign in to comment.