Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 용량 확보 #11

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading