From fcf75bf2ffa4074d718d21c284194684ccd3e84c Mon Sep 17 00:00:00 2001 From: Luke Else Date: Sat, 1 Feb 2025 13:29:05 +0000 Subject: [PATCH] Changed docker file to get uploaded to local registry --- .gitea/workflows/docker.yml | 46 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml index 4d21223..eb9e046 100644 --- a/.gitea/workflows/docker.yml +++ b/.gitea/workflows/docker.yml @@ -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 \ No newline at end of file + - 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