Skip to content

Commit 5a37d7e

Browse files
committed
perf: separate merges into submodules and parent-image
1 parent 6944b9c commit 5a37d7e

File tree

2 files changed

+117
-0
lines changed

2 files changed

+117
-0
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: 'Parent Images: Build'
2+
3+
on:
4+
workflow_call:
5+
6+
# Special permissions required for OIDC authentication
7+
permissions:
8+
id-token: write
9+
contents: read
10+
actions: read
11+
12+
env:
13+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
14+
15+
jobs:
16+
pi-build:
17+
name: 'Parent Images: Docker Build'
18+
runs-on: ubuntu-latest
19+
environment: dev
20+
env:
21+
PYTHON_VERSION: ${{ vars.PYTHON_VERSION }}
22+
DEV_CONTAINER_REGISTRY: ${{ vars.DEV_CONTAINER_REGISTRY }}
23+
DEV_LOGIN_USERNAME: ${{ secrets.DEV_LOGIN_USERNAME }}
24+
DEV_LOGIN_PASSWORD: ${{ secrets.DEV_LOGIN_PASSWORD }}
25+
PARENT_IMAGE_TYPE: ${{ vars.PARENT_IMAGE_TYPE }}
26+
DOCKERFILE: ${{ vars.DOCKERFILE }}
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
submodules: 'true'
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: ${{ env.PYTHON_VERSION }}
37+
38+
- name: Install Dependencies
39+
run: python -m pip install pip-tools
40+
41+
- name: Compile Requirements
42+
run: |
43+
cd ${{ github.workspace }}/submodules/parent-images
44+
pip-compile requirements/${{ env.PARENT_IMAGE_TYPE }}-requirements.in
45+
46+
- name: Set up Docker Buildx
47+
uses: docker/setup-buildx-action@v3
48+
with:
49+
platforms: linux/amd64,linux/arm64
50+
51+
- name: Set up QEMU
52+
uses: docker/setup-qemu-action@v3
53+
with:
54+
platforms: arm64,arm
55+
56+
- name: Log into DEV registry
57+
uses: docker/login-action@v3
58+
with:
59+
registry: "${{ env.DEV_CONTAINER_REGISTRY }}"
60+
username: "${{ env.DEV_LOGIN_USERNAME }}"
61+
password: "${{ env.DEV_LOGIN_PASSWORD }}"
62+
63+
- name: Build & Push refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}
64+
uses: docker/build-push-action@v5
65+
with:
66+
context: .
67+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-cache
68+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-cache,mode=max,image-manifest=true
69+
platforms: linux/amd64
70+
file: ${{ env.DOCKERFILE }}
71+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}
72+
push: true
73+
build-args: |
74+
platform=linux/amd64
75+
label=dockerfile-path=https://github.com/refinery-${{ env.PARENT_IMAGE_TYPE }}-parent-image/blob/${{ github.sha }}/Dockerfile
76+
77+
- name: Build & Push refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64
78+
uses: docker/build-push-action@v5
79+
with:
80+
context: .
81+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache
82+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache,mode=max,image-manifest=true
83+
platforms: linux/arm64
84+
file: ${{ env.DOCKERFILE }}
85+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64
86+
push: true
87+
build-args: |
88+
platform=linux/arm64
89+
label=dockerfile-path=https://github.com/refinery-${{ env.PARENT_IMAGE_TYPE }}-parent-image/blob/${{ github.sha }}/Dockerfile
90+
91+
- name: Build & Push refinery-parent-images:sha-${{ env.PARENT_IMAGE_TYPE }}
92+
uses: docker/build-push-action@v5
93+
with:
94+
context: .
95+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-cache
96+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-cache,mode=max,image-manifest=true
97+
platforms: linux/amd64
98+
file: ${{ env.DOCKERFILE }}
99+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}
100+
push: true
101+
build-args: |
102+
platform=linux/amd64
103+
label=dockerfile-path=https://github.com/refinery-${{ env.PARENT_IMAGE_TYPE }}-parent-image/blob/${{ github.sha }}/Dockerfile
104+
105+
- name: Build & Push refinery-parent-images:sha-${{ env.PARENT_IMAGE_TYPE }}-arm64
106+
uses: docker/build-push-action@v5
107+
with:
108+
context: .
109+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache
110+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache,mode=max,image-manifest=true
111+
platforms: linux/arm64
112+
file: ${{ env.DOCKERFILE }}
113+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-arm64
114+
push: true
115+
build-args: |
116+
platform=linux/arm64
117+
label=dockerfile-path=https://github.com/refinery-${{ env.PARENT_IMAGE_TYPE }}-parent-image/blob/${{ github.sha }}/Dockerfile

0 commit comments

Comments
 (0)