Skip to content

Commit

Permalink
Merge pull request #11 from studio-recoding/feat/cicd
Browse files Browse the repository at this point in the history
fix: 용량 확보
  • Loading branch information
uommou authored Mar 20, 2024
2 parents d7e72bb + 4a01dd9 commit c7412ec
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,32 @@ jobs:
push: true
tags: ${{ env.DOCKER_IMAGE }}:latest

# deploy:
# needs: build
# name: Deploy
# runs-on: [ self-hosted, label-NESS ]
# # label-newproject 라는 이름으로 AWS EC2 가 Runner 를 작동시킬 때 사용했던 그 label
# steps:
# - name: Login to ghcr
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GHCR_TOKEN }}
#
# - name: Docker run
# run: |
# docker stop ${{ env.NAME }} && docker rm ${{ env.NAME }} && docker rmi ${{ env.DOCKER_IMAGE }}:latest
# docker run -d -p 3000:3000 --name ness-fastapi --restart always ${{ env.DOCKER_IMAGE }}:latest
## docker pull ${{ env.DOCKER_IMAGE }}:latest
## docker stop ${{ env.NAME }} || true
## docker rm ${{ env.NAME }} || true
## docker rmi ${{ env.DOCKER_IMAGE }}:latest || true
## docker run -d -p 3000:3000 --name ${{ env.NAME }} --restart always ${{ env.DOCKER_IMAGE }}:latest
deploy:
needs: build
name: Deploy
runs-on: [ self-hosted, label-NESS ]
# label-newproject 라는 이름으로 AWS EC2 가 Runner 를 작동시킬 때 사용했던 그 label
steps:
- name: Login to ghcr
uses: docker/login-action@v1
Expand All @@ -60,12 +81,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Remove old Docker image
run: docker rmi -f ${{ env.DOCKER_IMAGE }}:latest || true

- name: Docker run
run: |
docker stop ${{ env.NAME }} && docker rm ${{ env.NAME }} && docker rmi ${{ env.DOCKER_IMAGE }}:latest
docker run -d -p 3000:3000 --name ness-fastapi --restart always ${{ env.DOCKER_IMAGE }}:latest
# docker pull ${{ env.DOCKER_IMAGE }}:latest
# docker stop ${{ env.NAME }} || true
# docker rm ${{ env.NAME }} || true
# docker rmi ${{ env.DOCKER_IMAGE }}:latest || true
# docker run -d -p 3000:3000 --name ${{ env.NAME }} --restart always ${{ env.DOCKER_IMAGE }}:latest
docker pull ${{ env.DOCKER_IMAGE }}:latest
docker stop ${{ env.NAME }} || true
docker rm ${{ env.NAME }} || true
docker run -d -p 3000:3000 --name ${{ env.NAME }} --restart always ${{ env.DOCKER_IMAGE }}:latest

0 comments on commit c7412ec

Please sign in to comment.