Skip to content

Added docker build/publish CI/CD #2

Added docker build/publish CI/CD

Added docker build/publish CI/CD #2

name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
environment: Docker-Prod-Build
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and tag Docker image
run: docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/mac-slider-generator:latest .
- name: Push Docker image to Docker Hub
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/mac-slider-generator:latest