layout domain #31
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: Gen20 Build and Push Docker Image | |
on: | |
push: | |
branches: | |
- main # Trigger on pushes to the 'main' branch | |
jobs: | |
build: | |
runs-on: debian-latest | |
steps: | |
# Checkout the code from GitHub repository | |
- name: Gen20 Checkout repository | |
uses: actions/checkout@v3 | |
# Set up Docker Buildx for building the Docker image | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Log in to Docker Hub using Docker Hub credentials | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# Build the Docker image and tag it with the Docker Hub repository | |
- name: Build and tag Docker image | |
run: | | |
docker build -t ${{ secrets.DOCKER_USERNAME }}/myimage:latest . | |
# Push the Docker image to Docker Hub | |
- name: Push Docker image to Docker Hub | |
run: | | |
docker push ${{ secrets.DOCKER_USERNAME }}/myimage:latest |