Skip to content
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

Use SP authentication in containers.yaml #341

Merged
merged 8 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
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
15 changes: 11 additions & 4 deletions .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,23 @@ jobs:
name: Build and push image

steps:
- name: Login to Azure
id: azure_login_2
uses: azure/login@v2
with:
creds: ${{ secrets.EDAV_STF_SERVICE_PRINCIPAL }}
damonbayer marked this conversation as resolved.
Show resolved Hide resolved

- name: Login to ACR
run: az acr login --name ${{ vars.CONTAINER_REGISTRY_NAME }}

- name: Build and push image
id: build-push
uses: CDCgov/cfa-actions/[email protected].0
uses: CDCgov/cfa-actions/[email protected].1
with:
registry: ${{ vars.CONTAINER_REGISTRY_NAME }}.azurecr.io/
container-file-1: ./Containerfile.dependencies
container-file-2: ./Containerfile
first-step-cache-key: docker-dependencies-${{ runner.os }}-${{ hashFiles('./Containerfile.dependencies') }}
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
image: ${{ env.IMAGE_NAME }}
build-args-2: |
TAG=${{ steps.image.outputs.tag }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/delete-container-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
delete:

env:
REGISTRY: ${{ vars.CONTAINER_REGISTRY }}
IMAGE_NAME: pyrenew-hew

jobs:
Expand Down Expand Up @@ -38,11 +37,11 @@ jobs:
# Remove the image from the registry
az acr repository delete \
--yes \
--name ${{ env.REGISTRY }} \
--name ${{ vars.CONTAINER_REGISTRY_NAME }} \
--image ${{ env.IMAGE_NAME }}:${{ steps.image-tag.outputs.tag }}

# Remove the dependencies image from the registry
az acr repository delete \
--yes \
--name ${{ env.REGISTRY }} \
--name ${{ vars.CONTAINER_REGISTRY_NAME }} \
--image ${{ env.IMAGE_NAME }}:dependencies-${{ steps.image-tag.outputs.tag }}
Loading