feat: The frontend docker build and push is added in the workflow. #12
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: Docker Build and Push | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Log in to DockerHub | |
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
- name: Build Docker image | |
run: | | |
docker build ./api/ -t surajkumar00/devops-url2qr-api:latest | |
docker build ./front-end-nextjs/ -t surajkumar00/devops-url2qr-frontend:latest | |
- name: Push Docker image to DockerHub | |
run: | | |
docker push surajkumar00/devops-url2qr-api:latest | |
docker push surajkumar00/devops-url2qr-frontend:latest | |