diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 6af1903..6a93839 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -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 diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 463cae6..fb4ad46 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -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