Skip to content

Commit

Permalink
workflows: Use docker build action
Browse files Browse the repository at this point in the history
Fixes the threads argument bug by passing it via environment variable.

Signed-off-by: Illia Vysochyn <[email protected]>
  • Loading branch information
ivysochyn committed Jul 12, 2024
1 parent 1345818 commit 6cb29c7
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/github-actions-publish-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
file: docker/Dockerfile.dev
build-args: |
fromImage=${{ matrix.os[1] }}
numThreads=$(nproc)
cache-from: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache,mode=max

Expand All @@ -66,6 +65,7 @@ jobs:
run: |
echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-test-cache/${{ matrix.os }}" >> $GITHUB_ENV
echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-test-cache-deps/${{ matrix.os }}" >> $GITHUB_ENV
echo "NUM_THREADS=$(nproc)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -78,14 +78,15 @@ jobs:
username: gha
password: ${{ github.token }}

- name: Export ORFS image
run: |
docker buildx build \
--build-arg fromImage=${{ env.IMAGE_DEPS }}:latest \
--build-arg numThreads=$(nproc) \
--cache-from type=registry,ref=${{ env.IMAGE }}:buildcache \
--cache-to type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max \
--tag ${{ env.IMAGE }}:latest \
--file docker/Dockerfile.builder \
--push \
.
- name: Build and export ORFS image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.IMAGE }}:latest
file: docker/Dockerfile.builder
build-args: |
fromImage=${{ env.IMAGE_DEPS }}
numThreads=${{ env.NUM_THREADS }}
cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max

0 comments on commit 6cb29c7

Please sign in to comment.