Changed docker file to get uploaded to local registry
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 36s

This commit is contained in:
Luke Else 2025-02-01 13:29:05 +00:00
parent 3c1a6e9ce0
commit fcf75bf2ff

View File

@ -7,28 +7,26 @@ on:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest # Use Ubuntu as the runner environment
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3 # Checkout the repository's code
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }} # Docker Hub username from GitHub Secrets
password: ${{ secrets.DOCKER_PASSWORD }} # Docker Hub password from GitHub Secrets
- name: Build Docker image
run: |
# Build the Docker image from the Dockerfile in the repo
docker build -t ${{ secrets.DOCKER_USERNAME }}/divine-couture.co.uk:latest .
- name: Push Docker image to Docker Hub
run: |
# Push the Docker image to Docker Hub
docker push ${{ secrets.DOCKER_USERNAME }}/divine-couture.co.uk:latest
- name: Logout from Docker Hub
run: docker logout
- name: Checkout Repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ secrets.CONTAINER_REGISTRY }}
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_PASSKEY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Tag Docker Image
run: |
docker build -t ${{ secrets.CONTAINER_REGISTRY }}/${{ secrets.CONTAINER_REGISTRY_USERNAME }}/divine-couture.co.uk:latest .
- name: Push Docker Image
run: |
docker push ${{ secrets.CONTAINER_REGISTRY }}/${{ secrets.CONTAINER_REGISTRY_USERNAME }}/divine-couture.co.uk:latest