fix: fetch the registry's `main` branch in the monorepo Docker image (#3841)

### Description

Infra services require the presence of a registry. This is expected to
be found at the env var REGISTRY_URI. This PR fetches the latest
registry from `main` and uses that as the registry in the monorepo image
for infra services / scripts to make use of. To prevent caching of this
git clone, we use a build-time arg such that if the arg changes, any
later layers in the image will be ran. See
https://stackoverflow.com/a/73501716

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

- Partially fixes
https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/3827 - we'll
need a deploy to fully close it out

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
pull/3846/head
Trevor Porter 6 months ago committed by GitHub
parent 3f2216574c
commit fdd1421540
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      .github/workflows/monorepo-docker.yml
  2. 7
      Dockerfile

@ -8,6 +8,8 @@ on:
paths: paths:
# For now, because this image is only used to use `infra`, we just build for infra changes # For now, because this image is only used to use `infra`, we just build for infra changes
- 'typescript/infra/**' - 'typescript/infra/**'
- 'Dockerfile'
- '.dockerignore'
concurrency: concurrency:
group: build-push-monorepo-${{ github.ref }} group: build-push-monorepo-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
@ -74,3 +76,6 @@ jobs:
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max 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 }}

@ -27,3 +27,10 @@ COPY typescript ./typescript
COPY solidity ./solidity COPY solidity ./solidity
RUN yarn build 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"

Loading…
Cancel
Save