Skip to content

Commit 2d6edc6

Browse files
committed
fix: use environment secrets instead of repo
1 parent 78a9c9f commit 2d6edc6

File tree

1 file changed

+45
-19
lines changed

1 file changed

+45
-19
lines changed

.github/workflows/pi_build.yml

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
pi-compile:
1717
name: 'Parent Images: Compile Requirements'
1818
runs-on: ubuntu-latest
19+
environment: dev
1920
env:
2021
PYTHON_VERSION: ${{ vars.PYTHON_VERSION }}
2122
outputs:
@@ -44,23 +45,16 @@ jobs:
4445
bash cicd-deployment-scripts/pi/compile.sh \
4546
-p "${{ github.event.pull_request.number }}"
4647
47-
- name: Dump job context
48-
env:
49-
JOB_CONTEXT: ${{ toJson(job) }}
50-
run: echo "$JOB_CONTEXT"
51-
5248
pi-build:
53-
name: 'Parent Images: Build'
49+
name: 'Parent Images: Docker Build'
5450
runs-on: ubuntu-latest
5551
needs: pi-compile
52+
environment: dev
5653
env:
5754
PYTHON_VERSION: ${{ vars.PYTHON_VERSION }}
5855
DEV_CONTAINER_REGISTRY: ${{ vars.DEV_CONTAINER_REGISTRY }}
5956
DEV_LOGIN_USERNAME: ${{ secrets.DEV_LOGIN_USERNAME }}
6057
DEV_LOGIN_PASSWORD: ${{ secrets.DEV_LOGIN_PASSWORD }}
61-
DOCKERHUB_CONTAINER_REGISTRY: ${{ vars.DOCKERHUB_CONTAINER_REGISTRY }}
62-
DOCKERHUB_LOGIN_USERNAME: ${{ secrets.DOCKERHUB_LOGIN_USERNAME }}
63-
DOCKERHUB_LOGIN_PASSWORD: ${{ secrets.DOCKERHUB_LOGIN_PASSWORD }}
6458
IMAGE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.pull_request.head.ref }}
6559
strategy:
6660
matrix:
@@ -89,22 +83,54 @@ jobs:
8983
username: "${{ env.DEV_LOGIN_USERNAME }}"
9084
password: "${{ env.DEV_LOGIN_PASSWORD }}"
9185

92-
- name: Log into Docker Hub registry
93-
uses: docker/login-action@v3
86+
- name: Build & Push refinery-${{ matrix.parent_image_type }}-parent-image:dev
87+
uses: docker/build-push-action@v5
9488
with:
95-
username: "${{ env.DOCKERHUB_LOGIN_USERNAME }}"
96-
password: "${{ env.DOCKERHUB_LOGIN_PASSWORD }}"
97-
98-
- name: Build & Push refinery-${{ matrix.parent_image_type }}-parent-image:amd64
99-
if: ${{ github.event_name != 'release' }}
89+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:dev-${{ matrix.parent_image_type }}-cache
90+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:dev-${{ matrix.parent_image_type }}-cache,mode=max,image-manifest=true
91+
platforms: linux/amd64
92+
file: Dockerfile
93+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:dev-${{ matrix.parent_image_type }}
94+
push: true
95+
build-args: |
96+
platform=linux/amd64
97+
label=dockerfile-path=https://github.com/refinery-${{ matrix.parent_image_type }}-parent-image/blob/${{ github.sha }}/Dockerfile
98+
99+
- name: Build & Push refinery-${{ matrix.parent_image_type }}-parent-image:dev-arm64
100100
uses: docker/build-push-action@v5
101101
with:
102-
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-image:dev-${{ matrix.parent_image_type }}-cache
103-
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-image:dev-${{ matrix.parent_image_type }}-cache,mode=max,image-manifest=true
102+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:dev-${{ matrix.parent_image_type }}-arm64-cache
103+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:dev-${{ matrix.parent_image_type }}-arm64-cache,mode=max,image-manifest=true
104+
platforms: linux/arm64
105+
file: Dockerfile
106+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:dev-${{ matrix.parent_image_type }}-arm64
107+
push: true
108+
build-args: |
109+
platform=linux/arm64
110+
label=dockerfile-path=https://github.com/refinery-${{ matrix.parent_image_type }}-parent-image/blob/${{ github.sha }}/Dockerfile
111+
112+
- name: Build & Push refinery-${{ matrix.parent_image_type }}-parent-image:sha
113+
uses: docker/build-push-action@v5
114+
with:
115+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}-cache
116+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}-cache,mode=max,image-manifest=true
104117
platforms: linux/amd64
105118
file: Dockerfile
106-
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-image:dev-${{ matrix.parent_image_type }}
119+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}
107120
push: true
108121
build-args: |
109122
platform=linux/amd64
110123
label=dockerfile-path=https://github.com/refinery-${{ matrix.parent_image_type }}-parent-image/blob/${{ github.sha }}/Dockerfile
124+
125+
- name: Build & Push refinery-${{ matrix.parent_image_type }}-parent-image:sha-arm64
126+
uses: docker/build-push-action@v5
127+
with:
128+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}-arm64-cache
129+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}-arm64-cache,mode=max,image-manifest=true
130+
platforms: linux/arm64
131+
file: Dockerfile
132+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ matrix.parent_image_type }}-arm64
133+
push: true
134+
build-args: |
135+
platform=linux/arm64
136+
label=dockerfile-path=https://github.com/refinery-${{ matrix.parent_image_type }}-parent-image/blob/${{ github.sha }}/Dockerfile

0 commit comments

Comments
 (0)