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