Skip to content

Commit

Permalink
feat(ci): respect platforms from Dockerfile props
Browse files Browse the repository at this point in the history
  • Loading branch information
JuniorJPDJ committed Mar 15, 2024
1 parent b2186e0 commit fe25c18
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- id: set-matrix
name: Generate containers list with parameters
- name: Generate containers list with parameters
id: set-matrix
working-directory: containers
run: |
{
Expand Down Expand Up @@ -55,6 +55,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Generate properties
id: props
run: |
PLATFORMS_DEFAULT="linux/amd64,linux/arm64"
PLATFORMS="${{ matrix.platforms }}"
{
echo "platforms=${PLATFORMS:-"${PLATFORMS_DEFAULT}"}"
} >> "$GITHUB_OUTPUT"
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -65,7 +75,7 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
Expand All @@ -85,7 +95,7 @@ jobs:
with:
context: containers/${{ matrix.container }}
push: true
platforms: linux/amd64,linux/arm64
platforms: ${{ steps.props.outputs.platforms }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down

0 comments on commit fe25c18

Please sign in to comment.