This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8643ee7
commit bcf9181
Showing
3 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
arch: [amd64, arm64] | ||
runs-on: ubuntu-latest | ||
env: | ||
IMG_CACHE: ghcr.io/getsentry/cdc:${{ matrix.arch }}-latest | ||
IMG_VERSIONED: ghcr.io/getsentry/cdc:${{ matrix.arch }}-${{ github.sha }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: docker run --rm --privileged tonistiigi/binfmt --install arm64 | ||
if: matrix.arch == 'arm64' | ||
- name: build | ||
run: | | ||
set -euxo pipefail | ||
args=() | ||
if docker pull -q "$IMG_CACHE"; then | ||
args+=(--cache-from "$IMG_CACHE") | ||
fi | ||
docker buildx build \ | ||
"${args[@]}" \ | ||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | ||
--platform linux/${{ matrix.arch }} \ | ||
--tag "$IMG_VERSIONED" \ | ||
--target application \ | ||
. | ||
docker tag "$IMG_VERSIONED" "$IMG_CACHE" | ||
- name: push | ||
run: | | ||
set -euxo pipefail | ||
docker login --username '${{ github.actor }}' --password '${{ secrets.GITHUB_TOKEN }}' ghcr.io | ||
docker push "$IMG_VERSIONED" | ||
docker push "$IMG_CACHE" | ||
if: github.event_name != 'pull_request' | ||
|
||
multiarch: | ||
if: github.event_name != 'pull_request' | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
set -euxo pipefail | ||
docker login --username '${{ github.actor }}' --password '${{ secrets.GITHUB_TOKEN }}' ghcr.io | ||
docker manifest create ghcr.io/getsentry/cdc:latest \ | ||
ghcr.io/getsentry/cdc:arm64-latest \ | ||
ghcr.io/getsentry/cdc:amd64-latest | ||
docker manifest push ghcr.io/getsentry/cdc:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters