Skip to content

Commit

Permalink
workflow editted
Browse files Browse the repository at this point in the history
  • Loading branch information
Luxshan2000 committed Sep 28, 2023
1 parent 49b9da2 commit edfb9ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build docker image
run: docker build -t luxshan/aws-pipeline .
run: docker build -t luxshan/aws-pipeline/backend:latest ./backend
- name: Publish image to docker hub
run: docker push luxshan/aws-pipeline:latest
run: docker push luxshan/aws-pipeline/backend:latest

deploy:
needs: build
runs-on: [aws-ec2]
steps:
- name: Pull image from docker hub
run: docker pull luxshan/aws-pipeline
run: docker pull luxshan/aws-pipeline/backend:latest
- name: Delete old container
run: docker rm -f aws-pipeline-container
run: docker rm -f aws-pipeline-backend-container
- name: Run docker container
run: docker run -d -p 3000:3000 --name aws-pipeline-container luxshan/aws-pipeline
run: docker run -d -p 3000:3000 --name aws-pipeline-backend-container luxshan/aws-pipeline/backend
12 changes: 7 additions & 5 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build docker image
run: docker build -t luxshan/aws-pipeline.
run: docker build -t luxshan/aws-pipeline/frontend:latest ./frontend
- name: Publish image to docker hub
run: docker push luxshan/aws-pipeline:latest
run: docker push luxshan/aws-pipeline/frontend:latest



deploy:
needs: build
runs-on: [aws-ec2]
steps:
- name: Pull image from docker hub
run: docker pull luxshan/aws-pipeline:latest
run: docker pull luxshan/aws-pipeline/frontend:latest
- name: Delete old container
run: docker rm -f aws-pipeline-container
run: docker rm -f aws-pipeline-frontend-container
- name: Run docker container
run: docker run -d -p 3000:3000 --name aws-pipeline-container luxshan/aws-pipeline
run: docker run -d -p 3000:3000 --name aws-pipeline-frontend-container luxshan/aws-pipeline/frontend

0 comments on commit edfb9ef

Please sign in to comment.