diff --git a/.github/workflows/monorepo-docker.yml b/.github/workflows/monorepo-docker.yml index 72a0fc1f1..b9d90db2b 100644 --- a/.github/workflows/monorepo-docker.yml +++ b/.github/workflows/monorepo-docker.yml @@ -8,6 +8,8 @@ on: paths: # For now, because this image is only used to use `infra`, we just build for infra changes - 'typescript/infra/**' + - 'Dockerfile' + - '.dockerignore' concurrency: group: build-push-monorepo-${{ github.ref }} cancel-in-progress: true @@ -74,3 +76,6 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max + # To always fetch the latest registry, we use the date as the cache key + build-args: | + REGISTRY_CACHE=${{ steps.taggen.outputs.TAG_DATE }} diff --git a/Dockerfile b/Dockerfile index 4a01616b8..763e1186f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,3 +27,10 @@ COPY typescript ./typescript COPY solidity ./solidity RUN yarn build + +ENV REGISTRY_URI="/hyperlane-registry" +# To allow us to avoid caching the registry clone, we use a build-time arg to force +# the below steps to be re-run if this arg is changed. +ARG REGISTRY_CACHE="default" + +RUN git clone https://github.com/hyperlane-xyz/hyperlane-registry.git "$REGISTRY_URI"