-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Pipeline to build and push Docker image to Docker Hub when there are changes in the main branch | ||
# Going to use actions from -> https://github.com/marketplace?query=docker | ||
name: Docker Build and Push Docker Image | ||
run-name: Build and Push Docker Image | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
docker: | ||
name: Build and Push Docker Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the code | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
# Login to Docker Hub | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{secrets.DOCKER_USERNAME}} # Docker Hub username | ||
password: ${{secrets.DOCKER_PASSWORD}} # Docker Hub password | ||
# Build the Docker image | ||
- name: Build anf Push Docker Image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: itzzjb/docker-react:latest |