Skip to content

Commit

Permalink
feat: Uses env vars to set selected docker platforms for build
Browse files Browse the repository at this point in the history
  • Loading branch information
dngrhm committed Aug 9, 2022
1 parent 75e336a commit b0e9c54
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ jobs:
- test-rosetta-cli-construction
- test-rosetta-cli-data
- test-tokens
env:
DOCKER_PLATFORMS: linux/amd64
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -557,9 +559,7 @@ jobs:
run: |
if [ ${{ steps.semantic.outputs.new_release_version }} ]
then
echo "::set-output name=platforms::linux/amd64,linux/arm/v7,linux/arm64/v8"
else
echo "::set-output name=platforms::linux/amd64"
echo "DOCKER_PLATFORMS=linux/amd64,linux/arm/v7,linux/arm64/v8" >> $GITHUB_ENV
fi
- name: Build/Tag/Push Image
Expand All @@ -568,9 +568,7 @@ jobs:
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ steps.docker_platforms.outputs.platforms }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: ${{ env.DOCKER_PLATFORMS }}
# Only push if (there's a new release on main branch, or if building a non-main branch) and (Only run on non-PR events or only PRs that aren't from forks)
push: ${{ (github.ref != 'refs/heads/master' || steps.semantic.outputs.new_release_version != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}

Expand Down

0 comments on commit b0e9c54

Please sign in to comment.