Skip to content

Update docker-image.yml #3

Update docker-image.yml

Update docker-image.yml #3

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main # Adjust this if your main branch has a different name
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository code
- name: Checkout repository
uses: actions/checkout@v3
# Set up Docker
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Build the Docker image with a lowercase tag
- name: Build Docker image
run: docker build -t studywizapp .
# Tag the Docker image for Docker Hub with a lowercase name
- name: Tag Docker image
run: docker tag studywizapp:latest ${{ secrets.DOCKER_USERNAME }}/studywizapp:latest
# Push the Docker image to Docker Hub
- name: Push Docker image to Docker Hub
run: docker push ${{ secrets.DOCKER_USERNAME }}/studywizapp:latest