Skip to content

draft: Testing composite action #4934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 19 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -451,42 +451,25 @@ jobs:

env:
PLATFORMS: "${{ join(fromJson(needs.build-setup.outputs.platforms), ',') }}"
DOCKER_IMAGE: "ghcr.io/getsentry/${{ matrix.image_name }}"
REVISION: "${{ github.event.pull_request.head.sha || github.sha }}"

steps:
- uses: actions/checkout@v4

- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3

- uses: actions/download-artifact@v5
with:
pattern: "${{ matrix.image_name }}@*"
merge-multiple: true

- name: Build and push to ghcr.io
if: "!github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]'"
run: |
docker login --username '${{ github.actor }}' --password '${{ secrets.GITHUB_TOKEN }}' ghcr.io

docker buildx build \
--platform "${PLATFORMS}" \
--tag "${DOCKER_IMAGE}:${REVISION}" \
$( [[ "${IS_MASTER}" == "true" ]] && printf %s "--tag ${DOCKER_IMAGE}:nightly" ) \
--file Dockerfile.release \
--push \
.

- name: Build and publish docker artifact
if: "github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]'"
run: |
docker buildx build \
--platform "${PLATFORMS}" \
--tag "${DOCKER_IMAGE}:${REVISION}" \
--file Dockerfile.release \
--output type=docker,dest=${{ matrix.image_name }}-docker-image \
.
uses: getsentry/action-build-and-push-images@444c0a2100a99eff7c7f24371241b6faf959d71d
with:
image_name: ${{ matrix.image_name }}
platforms: ${{ env.PLATFORMS }}
dockerfile_path: "./Dockerfile.release"
ghcr: true
google_ar: false
publish_on_pr: true

- name: Upload docker image
if: "github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]'"
Expand Down Expand Up @@ -521,21 +504,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3

# Logic taken from: publish-to-gcr
- name: Google Auth
id: auth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/868781662168/locations/global/workloadIdentityPools/prod-github/providers/github-oidc-pool
service_account: [email protected]

- name: Configure docker
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev

# Logic taken from: build-docker
- uses: actions/download-artifact@v5
with:
Expand All @@ -553,14 +521,17 @@ jobs:
done

- name: Build and push to Internal AR
run: |
docker buildx build \
--platform "${PLATFORMS}" \
--tag "${AR_DOCKER_IMAGE}:${REVISION}" \
$( [[ "${IS_MASTER}" == "true" ]] && printf %s "--tag ${AR_DOCKER_IMAGE}:latest" ) \
--file Dockerfile.release \
--push \
.
uses: getsentry/action-build-and-push-images@444c0a2100a99eff7c7f24371241b6faf959d71d
with:
image_name: ${{ matrix.image_name }}
platforms: ${{ env.PLATFORMS }}
dockerfile_path: "Dockerfile.release"
ghcr: false
publish_on_pr: true
google_ar: true
google_ar_image_name: ${{ env.AR_DOCKER_IMAGE }}
google_workload_identity_provider: projects/868781662168/locations/global/workloadIdentityPools/prod-github/providers/github-oidc-pool
google_service_account: [email protected]

publish-to-dockerhub:
needs: [build-setup, build-docker]
Expand Down
Loading