Skip to content

Commit

Permalink
added cache for docker images in actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ruoccofabrizio committed Jul 10, 2023
1 parent 8295f57 commit 30b0576
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/AdminWebApp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
5 changes: 3 additions & 2 deletions .github/workflows/Backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;

4 changes: 2 additions & 2 deletions .github/workflows/WebApp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 30b0576

Please sign in to comment.