Merge branch 'main' of https://github.com/KunalBhat55/PasswordGenApp #23
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: Build and Publish Docker Image | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
login-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# build-Push: | |
# runs-on: ubuntu-latest | |
# needs: login | |
# steps: | |
# - name: List Files in Repository | |
# run: ls -R | |
# - name: Build and push Docker image | |
# uses: docker/build-push-action@v4 | |
# with: | |
# file: ./Dockerfile | |
# push: true | |
# tags: kunalbhat55/cicd:passgenappv1 | |
- name: Build and push Docker image | |
run: | | |
docker build -t kunalbhat55/cicd:passgenappv1 ./ | |
docker push kunalbhat55/cicd:passgenappv1 | |