-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To allow docker cache reuse across images, we need to build the template workspace first, then build the other workspaces. This can be done by using the `workflow_run` event to trigger the build of the other workspaces. Since `workflow_run` does not natively support path matching, the `paths-filter` action is used to identify changed files and determine whether a workspace build is needed. Unfortunately, the paths-filter action does not function as intended when used with the workflow_run event due to the loss of commit information. To address this limitation, a workaround involving the use of artifacts between workflows is implemented to transfer the missing information. Since transferring artifacts across workflows is not natively supported, the community-provided download-artifact action variant is utilized. To allow the use of remote build cache, a non-default builder is required, which can be enabled by `docker/setup-buildx-action`. We can then use `--cache-from` and `--cache-to` flags to specify the cache. The dedicated cache registry and `max` mode seems to be required instead of the `inline` mode due to the use of multi-platform images and multi-stage builds. I'm not 100% sure if this is required though. References: * dorny/paths-filter * https://github.com/dorny/paths-filter?tab=readme-ov-file#examples * https://stackoverflow.com/a/70711156 * workflow_run * https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onworkflow_runbranchesbranches-ignore * https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_run * docker build cache * https://docs.docker.com/build/cache/backends/ * https://docs.docker.com/build/cache/backends/inline/ * https://docs.docker.com/build/cache/backends/registry/ * docker builder * https://docs.docker.com/build/builders/drivers/ * https://yuki-nakamura.com/2024/01/20/use-buildkit-from-docker-compose/ * https://docs.docker.com/reference/cli/docker/buildx/create/ * https://github.com/docker/buildx/blob/master/README.md#set-buildx-as-the-default-builder * docker/buildx#2142 (reply in thread)
- Loading branch information
Showing
11 changed files
with
657 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.