Skip to content

Commit

Permalink
chore: Update Dockerfile-nginx and Dockerfile-php for improved config…
Browse files Browse the repository at this point in the history
…uration
  • Loading branch information
Muneer-Shafi committed Jan 4, 2025
1 parent 4fdcb45 commit 744ec73
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,30 @@ on:
- completed

jobs:
build:
deploy:
runs-on: self-hosted

steps:
- name: Pull PHP Docker image
run: sudo docker pull muneer1997/demo_php:latest
- name: Checkout code
uses: actions/checkout@v4

- name: Pull NGINX Docker image
run: sudo docker pull muneer1997/demo_nginx:latest
- name: Login to Docker Hub
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Delete Old docker container
run: sudo docker rm -f demo_php || true
- name: Pull Docker images
run: |
docker pull muneer1997/demo_php:latest
docker pull muneer1997/demo_nginx:latest
- name: Delete Old docker container
run: sudo docker rm -f demo_nginx || true
- name: Stop and remove existing containers
run: |
docker-compose down || true
- name: Run Docker Container
run: docker compose up -d
- name: Deploy with Docker Compose
run: |
docker-compose up -d
- name: Clean up old images
run: |
docker image prune -f

0 comments on commit 744ec73

Please sign in to comment.