Skip to content

Commit

Permalink
Build caching for Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
baksetercx committed Mar 26, 2024
1 parent cda70df commit 7ddb8fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
unittests:
name: Unit Tests
runs-on: ubuntu-latest
if: false # TODO: remove
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -31,6 +32,7 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
if: false # TODO: remove
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -56,6 +58,7 @@ jobs:
name: Deploy AKS
needs: [build, analyze]
runs-on: ubuntu-latest
if: false # TODO: remove
environment: dev
steps:
- name: Checkout repository
Expand All @@ -73,6 +76,7 @@ jobs:
name: Deploy GKE
needs: [build, analyze]
runs-on: ubuntu-latest
if: false # TODO: remove
environment: dev
steps:
- name: Checkout repository
Expand Down
6 changes: 5 additions & 1 deletion build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ runs:
shell: bash
run: az acr login --name ${{ inputs.ACR_NAME }}

- name: Pull image (if exists) for cache
shell: bash
run: docker pull '${{ env.IMAGE_NAME }}:latest' || true

- name: Build image
uses: docker/build-push-action@v5
with:
context: ${{ env.DOCKER_DIR }}
push: false
load: true
tags: ${{ env.IMAGE_LONG_NAME }}
tags: '${{ env.IMAGE_LONG_NAME }},${{ env.IMAGE_NAME }}:latest'
cache-from: 'type=registry,ref=${{ env.IMAGE_NAME }}'
cache-to: 'type=inline'

Expand Down

0 comments on commit 7ddb8fc

Please sign in to comment.