promising solution using volume mount
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
@@ -44,7 +44,7 @@ jobs:
|
|||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ runner.temp }}/.buildx-cache
|
path: /opt/hostedtoolcache/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
- name: inject cache into docker
|
- name: inject cache into docker
|
||||||
uses: reproducible-containers/buildkit-cache-dance@v3.1.0
|
uses: reproducible-containers/buildkit-cache-dance@v3.1.0
|
||||||
with:
|
with:
|
||||||
cache-source: /root/.cache/pip
|
cache-source: /opt/hostedtoolcache/pip
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@@ -72,8 +72,8 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest
|
gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest
|
||||||
gitea.tryton.geeraert.eu/pi-ux-ce/django-python:${{ env.next_version }}
|
gitea.tryton.geeraert.eu/pi-ux-ce/django-python:${{ env.next_version }}
|
||||||
cache-from: type=local,src=${{ runner.temp }}/.buildx-cache
|
cache-from: type=local,src=/opt/hostedtoolcache/.buildx-cache
|
||||||
cache-to: type=local,dest=${{ runner.temp }}/.buildx-cache-new,mode=max
|
cache-to: type=local,dest=/opt/hostedtoolcache/.buildx-cache-new,mode=max
|
||||||
|
|
||||||
- name: Rollout Django to force pulling the new image
|
- name: Rollout Django to force pulling the new image
|
||||||
uses: actions-hub/kubectl@master
|
uses: actions-hub/kubectl@master
|
||||||
|
|||||||
+5
-5
@@ -8,11 +8,11 @@ WORKDIR /code/
|
|||||||
COPY requirements.txt ./
|
COPY requirements.txt ./
|
||||||
|
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip pip install --upgrade pip
|
RUN --mount=type=cache,target=/opt/hostedtoolcache/pip pip install --upgrade pip
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip pip list --outdated
|
RUN --mount=type=cache,target=/opt/hostedtoolcache/pip pip list --outdated
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip pip install --upgrade wheel
|
RUN --mount=type=cache,target=/opt/hostedtoolcache/pip pip install --upgrade wheel
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip pip install --upgrade setuptools
|
RUN --mount=type=cache,target=/opt/hostedtoolcache/pip pip install --upgrade setuptools
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt
|
RUN --mount=type=cache,target=/opt/hostedtoolcache/pip pip install -r requirements.txt
|
||||||
|
|
||||||
# Copy the rest of your application code (Changes frequently, invalidates subsequent cache)
|
# Copy the rest of your application code (Changes frequently, invalidates subsequent cache)
|
||||||
COPY . ./
|
COPY . ./
|
||||||
|
|||||||
Reference in New Issue
Block a user