Skip to content

Commit 470813f

Browse files
Update Cache In Main.yml
1 parent c3582ee commit 470813f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ jobs:
2929
with:
3030
python-version: ${{ env.PYTHON_VERSION }}
3131

32+
- name: Cache pip
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.cache/pip
36+
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('backend/requirements.txt') }}
37+
restore-keys: |
38+
${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-
39+
3240
- name: Install dependencies
3341
run: |
3442
python -m pip install --upgrade pip
@@ -85,6 +93,9 @@ jobs:
8593
username: ${{ github.actor }}
8694
password: ${{ secrets.GITHUB_TOKEN }}
8795

96+
- name: Set up Docker Buildx
97+
uses: docker/setup-buildx-action@v3
98+
8899
- name: Set image tags
89100
id: meta
90101
run: |
@@ -105,6 +116,8 @@ jobs:
105116
context: ./backend
106117
file: ./backend/Dockerfile
107118
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
119+
cache-from: type=gha
120+
cache-to: type=gha,mode=max
108121
tags: |
109122
${{ env.REGISTRY }}/${{ steps.image.outputs.backend }}:${{ steps.meta.outputs.sha_tag }}
110123
${{ env.REGISTRY }}/${{ steps.image.outputs.backend }}:${{ steps.meta.outputs.latest_tag }}
@@ -115,6 +128,8 @@ jobs:
115128
context: ./frontend
116129
file: ./frontend/Dockerfile
117130
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
131+
cache-from: type=gha
132+
cache-to: type=gha,mode=max
118133
tags: |
119134
${{ env.REGISTRY }}/${{ steps.image.outputs.frontend }}:${{ steps.meta.outputs.sha_tag }}
120135
${{ env.REGISTRY }}/${{ steps.image.outputs.frontend }}:${{ steps.meta.outputs.latest_tag }}

0 commit comments

Comments
 (0)