Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/codegen_image_cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Codegen image cache

# Seeds the buildkit cache for codegen.Dockerfile from main so pull request
# runs of generated_files.yml warm-start. PR-scoped cache writes are not
# readable by other PRs, so main is the only scope worth writing to.
on:
push:
branches: [main]
paths:
- 'codegen.Dockerfile'
- 'packages/connect-python/**'
- '.github/workflows/codegen_image_cache.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
seed:
name: Seed codegen image cache
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build codegen image and export cache
uses: docker/build-push-action@v6
with:
context: .
file: codegen.Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
4 changes: 3 additions & 1 deletion .github/workflows/generated_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ jobs:
file: codegen.Dockerfile
tags: codegen-env:latest
load: true # makes the image available for `docker run`
# Cache is seeded from main by codegen_image_cache.yml. No cache-to
# here: PR-scoped writes are unreadable by other PRs and only fill
# the repo's 10 GB Actions cache, evicting other caches.
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run codegen
run: CODEGEN_IMAGE=codegen-env:latest make codegen
Expand Down
Loading