Skip to content

.github/workflows/cd.yml #6

.github/workflows/cd.yml

.github/workflows/cd.yml #6

Workflow file for this run

name: CD Pipeline
on:
workflow_run:
workflows: ["CI Pipeline"]
types:
- completed
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Pull Docker image
run: sudo docker pull surajkumar00/ai-customer-support:latest
- name: Delete Old Docker Container
run: sudo docker rm -f ai-customer-support-container || true
- name: Run Docker Container
env:
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} # Pass the API key as an environment variable
run: |
sudo docker run -d -p 3000:3000 \
-e CLOUDFLARE_API_KEY=$CLOUDFLARE_API_KEY \
--name ai-customer-support-container surajkumar00/ai-customer-support