Skip to content

Commit

Permalink
feat: separated alpha cd workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kyY00n committed Oct 14, 2024
1 parent 81af506 commit a346109
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
33 changes: 12 additions & 21 deletions .github/workflows/frontend-deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Frontend Deploy to Dev

on:
pull_request:
push:
branches:
- develop
Expand Down Expand Up @@ -58,29 +59,19 @@ jobs:
context: ./frontend
file: ./frontend/Dockerfile.dev
push: true
tags: ${{ secrets.FRONTEND_IMAGE_NAME }}:latest
tags: ${{ secrets.FRONTEND_ALPHA_IMAGE_NAME }}:latest
platforms: |
linux/amd64
linux/arm64
deploy-to-develop-EC2:
needs: build-dockerfile
runs-on: front-dev-server

steps:
- name: Deploy to Develop EC2
run: |
docker stop ${{ secrets.FRONTEND_CONTAINER_NAME }} || true
docker rm ${{ secrets.FRONTEND_CONTAINER_NAME }} || true
docker pull ${{ secrets.FRONTEND_IMAGE_NAME }}:latest
docker run -d -p 3000:3000 --name ${{ secrets.FRONTEND_CONTAINER_NAME }} ${{ secrets.FRONTEND_IMAGE_NAME }}:latest
- name: Slack Notification
uses: 8398a7/action-slack@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
status: ${{ job.status }}
author_name: ํ”„๋ก ํŠธ์—”๋“œ ๋ฐฐํฌ ์•Œ๋ฆผ
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()
role-to-assume: arn:aws:iam::791335373803:role/SendCommandToEc2FromGithub
aws-region: ${{ secrets.AWS_REGION }}
- name: CD on EC2
uses: zip-go/[email protected]
instanceName: ${{ secrets.ALPHA_INSTANCE_NAME }}
workingDirectory: ${{ secrets.ALPHA_WORKING_DIRECTORY }}
command: |
docker compose restart zipgo-frontend
2 changes: 2 additions & 0 deletions backend/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ services:
env_file: "env.dev.properties"
ports:
- "8080:8080"
depends_on:
- mysql
2 changes: 1 addition & 1 deletion frontend/.env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FAST_REFRESH=true
BASE_URL=https://dev.api.zipgo.pet
BASE_URL=http://zipgo-backend
HOMEPAGE=https://dev.zipgo.pet

0 comments on commit a346109

Please sign in to comment.