Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.
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
48 changes: 48 additions & 0 deletions .github/actions/build_images_with_cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
inputs:
container-name:
description: "container name to build"
required: true

cache-key:
description: "key for actions/cache"
required: true

dockerfile-path:
description: "path to dockerfile"
required: true

builder-name:
description: "buildx.outputs.name"
required: true

target:
description: "target image"
required: true

runs:
using: "composite"
steps:
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache-${{ inputs.container-name }}
key: ${{ runner.os }}-${{ inputs.container-name }}-${{ inputs.cache-key }}
restore-keys: ${{ runner.os }}-${{ inputs.container-name }}-

- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./
file: ${{ inputs.dockerfile-path }}
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=local,scope=${{ inputs.container-name }},src=/tmp/.buildx-cache-${{ inputs.container-name }}
cache-to: type=local,mode=max,scope=${{ inputs.container-name }},dest=/tmp/.buildx-cache-${{ inputs.container-name }}-new
target: ${{ inputs.target }}
tags: tags_${{ inputs.container-name }}
load: true

- name: Move cache
shell: bash
run: |
rm -rf /tmp/.buildx-cache-${{ inputs.container-name }}
mv /tmp/.buildx-cache-${{ inputs.container-name }}-new /tmp/.buildx-cache-${{ inputs.container-name }}
43 changes: 43 additions & 0 deletions .github/actions/prepare_container_test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
runs:
using: "composite"
steps:
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install pipenv
shell: bash
run: pip install pipenv
working-directory: ./scripts

- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Build bts with cache
uses: ./.github/actions/build_images_with_cache
with:
container-name: "dev_bts"
cache-key: ${{ hashFiles('./packages/server/beaver_triple_service/**') }}
dockerfile-path: ./packages/server/beaver_triple_service/Dockerfile
builder-name: ${{ steps.buildx.outputs.name }}
target: "dev"

- name: Build cc with cache
uses: ./.github/actions/build_images_with_cache
with:
container-name: "dev_cc"
cache-key: ${{ hashFiles('./packages/server/computation_container/**') }}
dockerfile-path: ./packages/server/computation_container/Dockerfile
builder-name: ${{ steps.buildx.outputs.name }}
target: "dev"

- name: Build mc with cache
uses: ./.github/actions/build_images_with_cache
with:
container-name: "dev_mc"
cache-key: ${{ hashFiles('./packages/server/manage_container/**') }}
dockerfile-path: ./packages/server/manage_container/Dockerfile
builder-name: ${{ steps.buildx.outputs.name }}
target: "dev"
Loading