Skip to content

Commit

Permalink
fixup! ci(docker): run each platform on a different worker
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Jan 10, 2024
1 parent 025a29e commit 453fd99
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Proposal tests
# run on all PRs
on:
pull_request:
workflow_dispatch:
merge_group:
push:
branches: [main]
Expand All @@ -28,6 +29,7 @@ jobs:
DEFAULT_PLATFORM=linux/amd64
echo "default=$DEFAULT_PLATFORM" >> $GITHUB_OUTPUT
if ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}; then
# JSON-encoded list consisting only of the default platform.
platforms='["'"$DEFAULT_PLATFORM"'"]'
else
platforms='["linux/amd64","linux/arm64/v8"]'
Expand Down Expand Up @@ -105,11 +107,14 @@ jobs:
id: docker-tags
run: |
sep=
# A list of comma-separated tags to merge in the final image.
SUFFIXED=
# Our platform, replacing slashes with underscores.
uarch=$(echo "${{ matrix.platform }}" | tr / _)
for TAG in ${{ steps.meta.outputs.tags }}; do
SUFFIXED="$SUFFIXED$sep$TAG-$uarch"
if test -z "$sep"; then
# The first tag (suffixed with our architecture) is the one we build.
sep=,
echo "tag=$TAG-$uarch" >> $GITHUB_OUTPUT
fi
Expand Down Expand Up @@ -169,6 +174,7 @@ jobs:
- name: Push multiarch image
run: |
set -ex
# Push all tags, comprised of all architectures, to the registry.
for TAG in ${{ steps.docker-tags.outputs.tags }}; do
sources=
for ARCH in ${{ join(fromJson(needs.platforms.outputs.platforms), ' ') }}; do
Expand All @@ -178,3 +184,12 @@ jobs:
done
docker buildx imagetools create --tag "$TAG"$sources
done
- name: notify on failure
if: failure() && github.event_name != 'pull_request'
uses: ./.github/actions/notify-status
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
to: ${{ secrets.NOTIFY_EMAIL_TO }}
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}

0 comments on commit 453fd99

Please sign in to comment.