forked from codesquad-members-2023/second-hand-max
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fe-release' into dev-fe
- Loading branch information
Showing
8 changed files
with
79 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: issue-tracker auto deploy | ||
|
||
on: | ||
push: | ||
branches: [ "fe-release" ] | ||
|
||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
FE_WORKING_DIR: ./fe | ||
FE_ENV_PATH: ./.env | ||
FE_DOCKER_FILE_PATH: ./Dockerfile | ||
|
||
jobs: | ||
|
||
# job[2]: FRONTEND -> docker hub로 build & push | ||
fe-deploy: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ${{ env.FE_WORKING_DIR }} | ||
steps: | ||
|
||
# 1. Source 단계 | ||
- name: Checkout Source Code | ||
uses: actions/checkout@v3 | ||
|
||
# Node 세팅 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
|
||
# 2. .env 파일 변경 | ||
- name: create .env File | ||
run: | | ||
echo "${{ secrets.ENV }}" > "${{ env.FE_ENV_PATH }}" | ||
# 2. 도커파일 생성 | ||
- name: create Docker File | ||
run: | | ||
echo "${{ secrets.FE_DOCKER_FILE }}" > "${{ env.FE_DOCKER_FILE_PATH }}" | ||
|
||
# 2. docker hub로 build & push | ||
- name: docker build and push | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/team-5-second-hand-fe:latest . | ||
docker push ${{ secrets.DOCKER_USERNAME }}/team-5-second-hand-fe:latest | ||
# job[4]: EC2에서 docker 이미지 pull하고 실행 | ||
SSH-Transfer: | ||
needs: [ fe-deploy ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: SSH Transfer | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ubuntu | ||
key: ${{ secrets.KEY }} | ||
script: | | ||
sudo docker-compose down -v | ||
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/team-5-second-hand-fe:latest | ||
sudo docker-compose up -d | ||
sudo docker image prune -a -f |
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
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 |
---|---|---|
|
@@ -12,4 +12,4 @@ export const PATH = { | |
CALLBACK: '/callback/:provider', | ||
FALLBACK: '*', | ||
GOBACK: -1, | ||
}; | ||
}; |
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