-
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.
* fix: docker-compose.yml 경로 명시 * fix: 환경변수 프로파일 지정 * fix: 이미지 태깅 에러 픽스 * fix: 배포 환경변수 프로파일 설정 * fix: aics-server로 docker-compose와 이름 일치 * refactor: 애플리케이션 name aics-server로 도커 환경과 동일하게 변경 * refactor: 버전 고정 및 패스워드 전달 방식 수정 Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: 컴파일 에러 픽스 --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
85a5637
commit 186f82c
Showing
2 changed files
with
13 additions
and
10 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 |
---|---|---|
@@ -1,11 +1,16 @@ | ||
name: Build and Deploy to Dev Server | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-docker-image: | ||
runs-on: ubuntu-latest | ||
environment: dev | ||
|
||
steps: | ||
- name: get repo from github | ||
uses: actions/checkout@v3 | ||
|
@@ -33,29 +38,27 @@ jobs: | |
|
||
# Docker 이미지 빌드 | ||
- name: Docker image build | ||
env: | ||
IMAGE_TAG: ${{ github.sha }} | ||
run: | | ||
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/aics-api:$IMAGE_TAG . | ||
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/aics-api:$IMAGE_TAG ${{ secrets.DOCKERHUB_USERNAME }}/aics-api:latest | ||
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/aics-server:${{ github.sha }} . | ||
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/aics-server:${{ github.sha }} ${{ secrets.DOCKERHUB_USERNAME }}/aics-server:latest | ||
# Docker Hub 이미지 푸시 | ||
- name: docker Hub push | ||
run: | | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/aics-api:$IMAGE_TAG | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/aics-api:latest | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/aics-server:${{ github.sha }} | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/aics-server:latest | ||
deploy-to-dev: | ||
runs-on: ubuntu-latest | ||
needs: build-docker-image | ||
steps: | ||
- name: Deploy to dev | ||
- name: SSH to server and deploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SERVER_HOST }} | ||
username: ${{ secrets.SERVER_USERNAME }} | ||
password: ${{ secrets.SERVER_PASSWORD }} | ||
port: ${{ secrets.SERVER_PORT }} | ||
script: | | ||
sudo docker-compose pull ${{ secrets.DOCKERHUB_USERNAME }}/aics-api:latest | ||
sudo docker-compose up -d | ||
sudo -E docker-compose -f ${{ secrets.DOCKER_COMPOSE_YAML_PATH }} pull || exit 1 | ||
sudo -E docker-compose -f ${{ secrets.DOCKER_COMPOSE_YAML_PATH }} up -d || exit 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