-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 프론트엔드 배포 워크플로우 dev/prod 분리 (#389)
* refactor: dev/prod 분리 * fix: workflow 이름 구분 * chore: 워크플로우 테스트 * fix: dev용 준비 * fix: prod용 워크플로우 원상복구 * fix: dev서버 msw 동작하도록 수정 * fix: dev용 워크플로우 원상복구 * refactor: 주석 제거
- Loading branch information
Showing
6 changed files
with
85 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Frontend Deploy to Prod | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: frontend/** | ||
|
||
jobs: | ||
build-dockerfile: | ||
defaults: | ||
run: | ||
working-directory: frontend | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./frontend | ||
push: true | ||
tags: ${{ secrets.FRONTEND_IMAGE_NAME }}:latest | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
deploy-to-develop-EC2: | ||
needs: build-dockerfile | ||
runs-on: front-prod-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 | ||
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FAST_REFRESH=true | ||
BASE_URL=https://dev.api.zipgo.pet | ||
KAKAO_REDIRECT_URI=http://localhost:3000/login | ||
KAKAO_REDIRECT_URI=https://dev.zipgo.pet/login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters