CD Pipeline #35
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
name: CD Pipeline | |
on: | |
workflow_run: | |
workflows: ['Docker Image CI'] | |
types: | |
- completed | |
jobs: | |
deploy: | |
runs-on: self-hosted | |
steps: | |
- name: Pull Docker Image | |
run: sudo docker pull z00one/minori-rag-app:latest | |
- name: Delete Old Docker Container | |
run: sudo docker rm -f minori-rag-app-container || true | |
- name: Delete Old Docker Images | |
run: | | |
IMAGE_ID=$(sudo docker images -q z00one/minori-rag-app:latest) | |
sudo docker images -q | grep -v $IMAGE_ID | xargs -r sudo docker rmi | |
- name: Run Docker Container | |
run: | | |
sudo docker run -d \ | |
-p 3000:3000 \ | |
-p 5432:5432 \ | |
-e DATABASE_URL=${{ secrets.DATABASE_URL }} \ | |
-e JWT_ACCESS_SECRET=${{ secrets.JWT_ACCESS_SECRET }} \ | |
-e JWT_ACCESS_EXPIRATION=${{ secrets.JWT_ACCESS_EXPIRATION }} \ | |
-e AWS_REGION=${{ secrets.AWS_REGION }} \ | |
-e AWS_S3_ACCESS_KEY=${{ secrets.AWS_S3_ACCESS_KEY }} \ | |
-e AWS_S3_SECRET_ACCESS_KEY=${{ secrets.AWS_S3_SECRET_ACCESS_KEY }} \ | |
-e AWS_S3_BUCKET=${{ secrets.AWS_S3_BUCKET }} \ | |
-e AWS_CLOUDFRONT=${{ secrets.AWS_CLOUDFRONT }} \ | |
-e OPENAI_API_KEY_FOR_NEST=${{ secrets.OPENAI_API_KEY_FOR_NEST }} \ | |
-e LOCAL_STORAGE_PATH=${{ secrets.LOCAL_STORAGE_PATH }} \ | |
-e ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }} \ | |
-v ${{ secrets.VOLUME }}:${{ secrets.LOCAL_STORAGE_PATH }} \ | |
--restart always \ | |
--name minori-rag-app-container \ | |
z00one/minori-rag-app:latest |