diff --git a/.github/workflows/AdminWebApp.yml b/.github/workflows/AdminWebApp.yml index 6efa5d824..0f69484a0 100644 --- a/.github/workflows/AdminWebApp.yml +++ b/.github/workflows/AdminWebApp.yml @@ -22,8 +22,8 @@ jobs: - uses: actions/checkout@v3 - name: Build the Docker image run: - docker pull fruoccopublic.azurecr.io/rag-adminwebapp:latest; - docker build . --file docker/AdminWebApp.Dockerfile --tag fruoccopublic.azurecr.io/rag-adminwebapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; + docker pull fruoccopublic.azurecr.io/rag-adminwebapp:latest || true; + docker build . --file docker/AdminWebApp.Dockerfile --cache-from fruoccopublic.azurecr.io/rag-adminwebapp:latest --tag fruoccopublic.azurecr.io/rag-adminwebapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; docker tag fruoccopublic.azurecr.io/rag-adminwebapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER fruoccopublic.azurecr.io/rag-adminwebapp:latest; docker push fruoccopublic.azurecr.io/rag-adminwebapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; docker push fruoccopublic.azurecr.io/rag-adminwebapp:latest; diff --git a/.github/workflows/Backend.yml b/.github/workflows/Backend.yml index 920573f65..c4539edd7 100644 --- a/.github/workflows/Backend.yml +++ b/.github/workflows/Backend.yml @@ -22,8 +22,9 @@ jobs: - uses: actions/checkout@v3 - name: Build the Docker image run: - docker pull fruoccopublic.azurecr.io/rag-backend:latest; - docker build . --file docker/Backend.Dockerfile --tag fruoccopublic.azurecr.io/rag-backend:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; + docker pull fruoccopublic.azurecr.io/rag-backend:latest || true; + docker build . --file docker/Backend.Dockerfile --cache-from fruoccopublic.azurecr.io/rag-backend:latest --tag fruoccopublic.azurecr.io/rag-backend:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; docker tag fruoccopublic.azurecr.io/rag-backend:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER fruoccopublic.azurecr.io/rag-backend:latest; docker push fruoccopublic.azurecr.io/rag-backend:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; docker push fruoccopublic.azurecr.io/rag-backend:latest; + \ No newline at end of file diff --git a/.github/workflows/WebApp.yml b/.github/workflows/WebApp.yml index 4d5ca6b81..8b861eab9 100644 --- a/.github/workflows/WebApp.yml +++ b/.github/workflows/WebApp.yml @@ -22,8 +22,8 @@ jobs: - uses: actions/checkout@v3 - name: Build the Docker image run: - docker pull fruoccopublic.azurecr.io/rag-webapp:latest; - docker build . --file docker/WebApp.Dockerfile --tag fruoccopublic.azurecr.io/rag-webapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; + docker pull fruoccopublic.azurecr.io/rag-webapp:latest || true; + docker build . --file docker/WebApp.Dockerfile --cache-from fruoccopublic.azurecr.io/rag-webapp:latest --tag fruoccopublic.azurecr.io/rag-webapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; docker tag fruoccopublic.azurecr.io/rag-webapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER fruoccopublic.azurecr.io/rag-webapp:latest; docker push fruoccopublic.azurecr.io/rag-webapp:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER; docker push fruoccopublic.azurecr.io/rag-webapp:latest;