Revert "Merge pull request #14 from lakbot/main" #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build and test frontend | |
run: | | |
docker build -f frontend/Dockerfile -t sandalidisara/event_mng_ctse:latest-frontend . | |
docker images | |
#comment for testing | |
# - name: Tag frontend image | |
# run: | | |
# docker tag ctse_assignment-frontend:latest "${{ secrets.DOCKER_USERNAME }}/ctse_assignment-frontend:latest" | |
- name: Build and test backend | |
run: | | |
docker build -f backend/Dockerfile -t sandalidisara/event_mng_ctse:latest-backend . | |
docker images | |
#comment for testing | |
# - name: Tag backend image | |
# run: | | |
# docker tag ctse_assignment-backend:latest "${{ secrets.DOCKER_USERNAME }}/ctse_assignment-backend:latest" | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Log in to Docker Hub | |
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u sandalidisara --password-stdin | |
- name: Push frontend image to Docker Hub | |
run: docker push sandalidisara/event_mng_ctse:latest-frontend | |
- name: Push backend image to Docker Hub | |
run: docker push sandalidisara/event_mng_ctse:latest-backend |