Optimize image builds by caching intermediate layers #164
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
@ -25,14 +25,24 @@ jobs:
|
|||||||
username: ${{ secrets.PRIVATE_REGISTRY_USERNAME }}
|
username: ${{ secrets.PRIVATE_REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.PRIVATE_REGISTRY_TOKEN }}
|
password: ${{ secrets.PRIVATE_REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push intermediate stages
|
- name: Build and push intermediate stages (deps)
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
target: build
|
target: deps
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:build
|
tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:deps
|
||||||
cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:build
|
cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:deps
|
||||||
|
cache-to: type=inline
|
||||||
|
|
||||||
|
- name: Build and push intermediate stages (builder)
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
target: builder
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:builder
|
||||||
|
cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:builder
|
||||||
cache-to: type=inline
|
cache-to: type=inline
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
|
Loading…
x
Reference in New Issue
Block a user