-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: reintroduce push images to ACR (#1311)
This PR reintroduces changes from #1285 And on top of it adds environments for the `push-to-acr` workflow to fix pushing to ACR for `tags` events (see details in neondatabase/infra#3241)
- Loading branch information
Showing
4 changed files
with
100 additions
and
7 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
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,59 @@ | ||
name: Push images to ACR | ||
on: | ||
workflow_call: | ||
inputs: | ||
client_id: | ||
description: Client ID of Azure managed identity or Entra app | ||
required: true | ||
type: string | ||
image_tag: | ||
description: Tag for the container images | ||
required: true | ||
type: string | ||
images: | ||
description: List of images | ||
required: true | ||
type: string | ||
registry_name: | ||
description: Name of the container registry | ||
required: true | ||
type: string | ||
subscription_id: | ||
description: Azure subscription ID | ||
required: true | ||
type: string | ||
tenant_id: | ||
description: Azure tenant ID | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
push-to-acr: | ||
runs-on: ubuntu-22.04 | ||
environment: ${{ inputs.client_id == vars.AZURE_PROD_CLIENT_ID && 'prod' || 'dev' }}-azure-eastus2 | ||
permissions: | ||
contents: read # This is required for actions/checkout | ||
id-token: write # This is required for Azure Login to work. | ||
|
||
steps: | ||
- name: Azure login | ||
uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # @v2.1.1 | ||
with: | ||
client-id: ${{ inputs.client_id }} | ||
subscription-id: ${{ inputs.subscription_id }} | ||
tenant-id: ${{ inputs.tenant_id }} | ||
|
||
- name: Login to ACR | ||
run: | | ||
az acr login --name=${{ inputs.registry_name }} | ||
- name: Copy docker images to ACR ${{ inputs.registry_name }} | ||
env: | ||
IMAGES: ${{ inputs.images }} | ||
TAG: ${{ inputs.image_tag }} | ||
run: | | ||
for image in ${IMAGES}; do | ||
docker buildx imagetools create \ | ||
-t ${{ inputs.registry_name }}.azurecr.io/neondatabase/${image}:${TAG} \ | ||
neondatabase/${image}:${TAG} | ||
done |
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