Skip to content

Commit

Permalink
bug fixes in cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
ronylpatil committed May 17, 2024
1 parent b897e07 commit 8f67441
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 45 deletions.
58 changes: 29 additions & 29 deletions .github/workflows/build_push_img.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ jobs:

build-nd-push-docker-image:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: build & push img to dockerhub
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Print Current Directory be-down # for debug purpose
run: ls /home/runner/work/cicd-aws/cicd-aws

- name: Download Model Artifacts # download the previously saved artifacts
uses: actions/download-artifact@v2
with:
name: model
path: /home/runner/work/cicd-aws/cicd-aws
- name: Print Current Directory af-down # for debugging
run: ls /home/runner/work/cicd-aws/cicd-aws

# push img to docker hub
- name: Build Docker Image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/wineqcicdaws:latest .
- name: Log-in to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push Docker Img # push the previously built img to dockerhub
run: docker push ${{ secrets.DOCKER_USERNAME }}/wineqcicdaws:latest
runs-on: ubuntu-latest
name: build & push img to dockerhub
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Print Current Directory be-down # for debug purpose
run: ls /home/runner/work/cicd-aws/cicd-aws

- name: Download Model Artifacts # download the previously saved artifacts
uses: actions/download-artifact@v2
with:
name: model
path: /home/runner/work/cicd-aws/cicd-aws

- name: Print Current Directory af-down # for debugging
run: ls /home/runner/work/cicd-aws/cicd-aws

# push img to docker hub
- name: Build Docker Image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/wineqcicdaws:latest .
- name: Log-in to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Push Docker Img # push the previously built img to dockerhub
run: docker push ${{ secrets.DOCKER_USERNAME }}/wineqcicdaws:latest
32 changes: 16 additions & 16 deletions .github/workflows/continuous_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ on:
jobs:
continuous-deployment:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: continuous deployment
runs-on: self-hosted
steps:
- name: pull latest image from docker hub
run: |
docker image pull ${{ secrets.DOCKER_USERNAME }}/wineqcicdaws:latest
- name: Print docker images # for debugging
run: docker images
- name: Delete Previous Container
run: |
docker rm -f awscicd || true
runs-on: self-hosted
name: continuous deployment
steps:
- name: pull latest image from docker hub
run: |
docker image pull ${{ secrets.DOCKER_USERNAME }}/wineqcicdaws:latest
- name: Print docker images # for debugging
run: docker images

- name: Delete Previous Container
run: |
docker rm -f awscicd || true
- name: Run Docker Image to Serve Users
run: |
docker run -d -p 8082:8000 -ti --name awscicd ${{ secrets.DOCKER_USERNAME }}/wineqcicdaws:latest
- name: Run Docker Image to Serve Users
run: |
docker run -d -p 8082:8000 -ti --name awscicd ${{ secrets.DOCKER_USERNAME }}/wineqcicdaws:latest

0 comments on commit 8f67441

Please sign in to comment.