diff --git a/.github/workflows/backend-deploy.yml b/.github/workflows/backend-deploy.yml index c5ac63d..84c561c 100644 --- a/.github/workflows/backend-deploy.yml +++ b/.github/workflows/backend-deploy.yml @@ -1,19 +1,26 @@ -name: Build and Deploy Backend +name: CI/CD Pipeline for Backend on: push: - branches: [ pipeline ] + branches: [ pipeline ] jobs: - build: + build_and_push_backend: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Build and push Docker image for Backend - uses: docker/build-push-action@v2 - with: - context: ./server - file: ./server/Dockerfile - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_BACKEND_REPO }}:latest + - name: Check Out Repo + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Docker image for Backend + uses: docker/build-push-action@v2 + with: + context: ./server + file: ./server/Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_BACKEND_REPO }}:latest diff --git a/.github/workflows/frontend-deploy.yml b/.github/workflows/frontend-deploy.yml index 2e14801..3a795d1 100644 --- a/.github/workflows/frontend-deploy.yml +++ b/.github/workflows/frontend-deploy.yml @@ -1,20 +1,26 @@ -name: Build and Deploy Frontend +name: CI/CD Pipeline for Frontend on: push: - branches: [ pipeline ] - + branches: [ pipeline ] jobs: - build: + build_and_push_frontend: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Build and push Docker image for Frontend - uses: docker/build-push-action@v2 - with: - context: ./client - file: ./client/Dockerfile - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_FRONTEND_REPO }}:latest + - name: Check Out Repo + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Docker image for Frontend + uses: docker/build-push-action@v2 + with: + context: ./client + file: ./client/Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_FRONTEND_REPO }}:latest