Modified: backend Dockerfile, fixed the production dependencies command #9
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: | |
- docker_config | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Set up Docker Buildx | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Log in to DockerHub (or another container registry) | |
- name: Log in to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# Build and push the frontend image | |
- name: Build and Push Frontend Image | |
run: | | |
FRONT_IMAGE_TAG=$(date +%Y%m%d%H%M) | |
docker build -t hartypotter/frontend:latest ./Frontend | |
docker tag hartypotter/frontend:latest hartypotter/frontend:$FRONT_IMAGE_TAG | |
docker push hartypotter/frontend:latest | |
docker push hartypotter/frontend:$FRONT_IMAGE_TAG | |
# Build and push the backend image | |
- name: Build and Push Backend Image | |
run: | | |
BACK_IMAGE_TAG=$(date +%Y%m%d%H%M) | |
docker build -t hartypotter/backend:latest ./Backend | |
docker tag hartypotter/backend:latest hartypotter/backend:$BACK_IMAGE_TAG | |
docker push hartypotter/backend:latest | |
docker push hartypotter/backend:$BACK_IMAGE_TAG |