Skip to content

Commit e0f89b0

Browse files
johnmathewsclaude
andcommitted
Use docker/login-action for ACR instead of azure/login
Simpler auth: use service principal clientId/password directly with docker/login-action. Gated on ACR_LOGIN_SERVER variable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ad9532e commit e0f89b0

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

.github/workflows/docker.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ jobs:
1818
dockerfile: src/gateway/Dockerfile
1919
- image: worker
2020
dockerfile: src/worker/Dockerfile
21-
env:
22-
HAS_AZURE: ${{ secrets.AZURE_CREDENTIALS != '' }}
2321
steps:
2422
- uses: actions/checkout@v4
2523

@@ -29,15 +27,13 @@ jobs:
2927
username: ${{ github.actor }}
3028
password: ${{ secrets.GITHUB_TOKEN }}
3129

32-
- name: Log in to Azure
33-
if: env.HAS_AZURE == 'true'
34-
uses: azure/login@v2
35-
with:
36-
creds: ${{ secrets.AZURE_CREDENTIALS }}
37-
3830
- name: Log in to ACR
39-
if: env.HAS_AZURE == 'true'
40-
run: az acr login -n acrdocumentstream
31+
if: ${{ vars.ACR_LOGIN_SERVER != '' }}
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ${{ vars.ACR_LOGIN_SERVER }}
35+
username: ${{ secrets.ACR_CLIENT_ID }}
36+
password: ${{ secrets.ACR_CLIENT_SECRET }}
4137

4238
- uses: docker/build-push-action@v6
4339
with:
@@ -49,11 +45,11 @@ jobs:
4945
ghcr.io/johnmathews/documentstream-${{ matrix.image }}:${{ github.sha }}
5046
5147
- name: Push to ACR
52-
if: env.HAS_AZURE == 'true'
48+
if: ${{ vars.ACR_LOGIN_SERVER != '' }}
5349
run: |
5450
docker tag ghcr.io/johnmathews/documentstream-${{ matrix.image }}:${{ github.sha }} \
55-
acrdocumentstream.azurecr.io/${{ matrix.image }}:${{ github.sha }}
51+
${{ vars.ACR_LOGIN_SERVER }}/${{ matrix.image }}:${{ github.sha }}
5652
docker tag ghcr.io/johnmathews/documentstream-${{ matrix.image }}:${{ github.sha }} \
57-
acrdocumentstream.azurecr.io/${{ matrix.image }}:latest
58-
docker push acrdocumentstream.azurecr.io/${{ matrix.image }}:${{ github.sha }}
59-
docker push acrdocumentstream.azurecr.io/${{ matrix.image }}:latest
53+
${{ vars.ACR_LOGIN_SERVER }}/${{ matrix.image }}:latest
54+
docker push ${{ vars.ACR_LOGIN_SERVER }}/${{ matrix.image }}:${{ github.sha }}
55+
docker push ${{ vars.ACR_LOGIN_SERVER }}/${{ matrix.image }}:latest

0 commit comments

Comments
 (0)