Skip to content

Commit

Permalink
Use SP authentication in containers.yaml (#341)
Browse files Browse the repository at this point in the history
* Use SP authentication in containers.yaml

* Update containers.yaml

* Update delete-container-tag.yaml

Fix warning

* Format files

* Update containers.yaml

* Update containers.yaml

---------

Co-authored-by: Damon Bayer <[email protected]>
  • Loading branch information
dylanhmorris and damonbayer authored Feb 12, 2025
1 parent d8534e9 commit 800a23f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
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 }}

- 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 }}

0 comments on commit 800a23f

Please sign in to comment.