Skip to content

Commit

Permalink
corrected the matrix for the github action
Browse files Browse the repository at this point in the history
  • Loading branch information
romer8 committed May 6, 2024
1 parent cc14e49 commit d33c083
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build_and_push_dev_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Set Tag
run: |
echo "TAG=dev_${GITHUB_SHA}" >> $GITHUB_ENV
echo "TAG_LATEST=dev_latest" >> $GITHUB_ENV
- name: Set matrix for build
id: set-matrix
run: echo "::set-output name=matrix::{\"include\":[{\"platform\":\"linux/amd64\",\"tag\":\"user/repo:latest-amd64\"},{\"platform\":\"linux/arm64\",\"tag\":\"user/repo:latest-arm64\"}]}"
run: echo "::set-output name=matrix::{\"include\":[{\"platform\":\"linux/amd64\",\"tag\":\"${{ env.DOCKER_HUB_ORG }}/${{ env.DOCKER_REPO }}:${{ env.TAG_LATEST }}_amd64\"},{\"platform\":\"linux/arm64\",\"tag\":\"${{ env.DOCKER_HUB_ORG }}/${{ env.DOCKER_REPO }}:${{ env.TAG_LATEST }}_arm64\"}]}"
# build image
build:
needs: setup
Expand Down Expand Up @@ -56,9 +60,7 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: |
${{ env.DOCKER_HUB_ORG }}/${{ env.DOCKER_REPO }}:${{ env.TAG }}_${{ matrix.tag }}
${{ env.DOCKER_HUB_ORG }}/${{ env.DOCKER_REPO }}:${{ env.TAG_LATEST }}_${{ matrix.tag }}
tags: ${{ matrix.tag }}
platforms: ${{ matrix.platform }}
cache-from: type=registry,ref=${{ env.DOCKER_HUB_ORG }}/${{ env.DOCKER_REPO }}-dev-${{ matrix.platform }}-cache:latest
cache-to: type=registry,ref=${{ env.DOCKER_HUB_ORG }}/${{ env.DOCKER_REPO }}-dev-${{ matrix.platform }}-cache:latest,mode=max
Expand Down

0 comments on commit d33c083

Please sign in to comment.