Skip to content

Commit

Permalink
Managed identity azure container push.
Browse files Browse the repository at this point in the history
  • Loading branch information
shammowla committed Sep 5, 2024
1 parent 3b553fb commit dde407b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,18 @@ jobs:
echo "APP_DOMAIN=ajo.alloyio.com" >> $GITHUB_ENV
echo "COMPOSE_FILE=docker/ajo.yml" >> $GITHUB_ENV
echo "SERVICE_NAME=$(echo ${{ matrix.sample }} | sed 's/^ajo-//')" >> $GITHUB_ENV
- name: Login to Azure Container Registry
- name: Get ACR credentials
run: |
az acr login --name ${{ env.ACR_NAME }}
ACR_USERNAME=$(az acr credential show -n ${{ env.ACR_NAME }} --query username -o tsv)
ACR_PASSWORD=$(az acr credential show -n ${{ env.ACR_NAME }} --query "passwords[0].value" -o tsv)
echo "ACR_USERNAME=$ACR_USERNAME" >> $GITHUB_ENV
echo "ACR_PASSWORD=$ACR_PASSWORD" >> $GITHUB_ENV
- name: Login to Azure Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.ACR_NAME }}
username: ${{ env.ACR_USERNAME }}
password: ${{ env.ACR_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t ${{ env.ACR_NAME }}/${{ matrix.sample }}:${{ github.sha }} -f ${{ env.COMPOSE_FILE }} .
Expand Down

0 comments on commit dde407b

Please sign in to comment.