Skip to content

Commit

Permalink
Merge pull request #18 from studio-recoding/feat/cicd
Browse files Browse the repository at this point in the history
[chore] secrets 추가
  • Loading branch information
uommou authored Mar 22, 2024
2 parents 44d9672 + 20f0d9f commit 46961b7
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,6 @@ 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
# EC2 볼륨 16기가로 늘려서 테스트 -> 파티션 용량 조절 필요
deploy:
needs: build
Expand All @@ -81,6 +59,12 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Create .env file
run: |
echo NAME=${{ env.NAME }} > .env
echo VERSION=${{ env.VERSION }} >> .env
echo OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} >> .env
echo CHROMA_DB_IP_ADDRESS=${{ secrets.CHROMA_DB_IP_ADDRESS }} >> .env
- name: Remove old Docker image
run: docker rmi -f $(docker images -aq) || true #docker rmi -f ${{ env.DOCKER_IMAGE }}:latest || true
Expand Down

0 comments on commit 46961b7

Please sign in to comment.