Skip to content

something has changed #5

something has changed

something has changed #5

Workflow file for this run

name: Microservices Deployment
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Build and push the specific microservice that has been updated
- name: Deploy Microservice
working-directory: backend/${{ matrix.microservice }}
if: ${{ github.event_path == 'backend/${{ matrix.microservice }}' || contains(github.event.commits.*.added, 'backend/${{ matrix.microservice }}') || contains(github.event.commits.*.modified, 'backend/${{ matrix.microservice }}') }}
run: |
docker build -t rubel49882/${{ matrix.microservice }}:${{ github.sha }} .
docker push rubel49882/${{ matrix.microservice }}:${{ github.sha }}
# Build and push the frontend
- name: Deploy Frontend
working-directory: frontend
if: ${{ github.event_path == 'frontend' || contains(github.event.commits.*.added, 'frontend') || contains(github.event.commits.*.modified, 'frontend') }}
run: |
docker build -t rubel49882/frontend:${{ github.sha }} .
docker push rubel49882/frontend:${{ github.sha }}
strategy:
matrix:
microservice:
- admin-microservice
- cart-microservice
- customer-microservice
- order-microservice
- seller-microservice
- user-microservice