Skip to content

Commit

Permalink
Updated the building process for better caching
Browse files Browse the repository at this point in the history
  • Loading branch information
icehaunter committed Oct 9, 2024
1 parent 7fa7aa0 commit 80134c1
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/benchmarking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,34 @@ jobs:
run: "gcloud info"
- name: Docker auth
run: gcloud auth configure-docker europe-docker.pkg.dev --quiet
- name: Pull latest base image
run: docker pull electricsql/electric:canary
- name: Build image
run: docker build --push --cache-from=electricsql/electric:canary --tag ${{ env.REGISTRY }}/electric:${{ github.event.number }} .
- name: Pull latest base images
run: |
docker pull ${{ env.REGISTRY }}/electric:canary-builder || true
docker pull ${{ env.REGISTRY }}/electric:canary-runner-base || true
docker pull ${{ env.REGISTRY }}/electric:pr-${{ github.event.number }}-builder || true
docker pull ${{ env.REGISTRY }}/electric:pr-${{ github.event.number }}-runner-base || true
- name: Build base images
run: >
docker build
--push
--cache-from=${{ env.REGISTRY }}/electric:canary-builder
--cache-from=${{ env.REGISTRY }}/electric:pr-${{ github.event.number }}-builder
--tag ${{ env.REGISTRY }}/electric:pr-${{ github.event.number }}-builder
--target builder
.
docker build
--push
--cache-from=${{ env.REGISTRY }}/electric:canary-runner-base
--cache-from=${{ env.REGISTRY }}/electric:pr-${{ github.event.number }}-runner-base
--tag ${{ env.REGISTRY }}/electric:pr-${{ github.event.number }}-runner-base
--target runner_setup
.
- name: Build actual image
run: >
docker build
--push
--cache-from=${{ env.REGISTRY }}/electric:pr-${{ github.event.number }}-builder
--cache-from=${{ env.REGISTRY }}/electric:pr-${{ github.event.number }}-runner-base
--tag ${{ env.REGISTRY }}/electric:pr-${{ github.event.number }}-${{ github.sha }}
.

0 comments on commit 80134c1

Please sign in to comment.