change cash #46
20
.github/workflows/build.yaml
vendored
20
.github/workflows/build.yaml
vendored
@@ -69,9 +69,10 @@ jobs:
|
|||||||
- name: Restore Docker layer cache
|
- name: Restore Docker layer cache
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
with:
|
with:
|
||||||
path: /cache/buildx-cache
|
path: /cache/${{ github.repository }}/buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles('Dockerfile', '**/requirements.txt', '**/*lock*', '**/package-lock.json', '**/poetry.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
|
${{ runner.os }}-${{ github.repository }}-buildx-
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Build and push multi-arch image
|
- name: Build and push multi-arch image
|
||||||
@@ -90,17 +91,18 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
GIT_COMMIT=${{ github.sha }}
|
GIT_COMMIT=${{ github.sha }}
|
||||||
cache-from: |
|
cache-from: |
|
||||||
type=local,src=/cache/buildx-cache
|
type=local,src=/cache/${{ github.repository }}/buildx-cache
|
||||||
cache-to: |
|
cache-to: |
|
||||||
type=local,dest=/cache/buildx-cache-new,mode=max
|
type=local,dest=/cache/${{ github.repository }}/buildx-cache-new,mode=max
|
||||||
|
|
||||||
- name: Move new cache if it exists
|
- name: Move new cache if it exists
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
if [ -d /cache/buildx-cache-new ]; then
|
mkdir -p /cache/${{ github.repository }}
|
||||||
|
if [ -d /cache/${{ github.repository }}/buildx-cache-new ]; then
|
||||||
echo "Found new buildx cache, replacing old one..."
|
echo "Found new buildx cache, replacing old one..."
|
||||||
rm -rf /cache/buildx-cache
|
rm -rf /cache/${{ github.repository }}/buildx-cache
|
||||||
mv /cache/buildx-cache-new /cache/buildx-cache
|
mv /cache/${{ github.repository }}/buildx-cache-new /cache/${{ github.repository }}/buildx-cache
|
||||||
else
|
else
|
||||||
echo "No new buildx cache found, keeping old one."
|
echo "No new buildx cache found, keeping old one."
|
||||||
fi
|
fi
|
||||||
@@ -109,8 +111,8 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
with:
|
with:
|
||||||
path: /cache/buildx-cache
|
path: /cache/${{ github.repository }}/buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-${{ github.repository }}-buildx-${{ hashFiles('Dockerfile', '**/requirements.txt', '**/*lock*', '**/package-lock.json', '**/poetry.lock') }}
|
||||||
|
|
||||||
- name: Notify (result)
|
- name: Notify (result)
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
Reference in New Issue
Block a user