Skip to content

Commit b876ce6

Browse files
authored
devops: migrate to OIDC for Docker publishing (#2914)
1 parent 57d81d4 commit b876ce6

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/publish_docker.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,27 @@ jobs:
1616
name: "publish to DockerHub"
1717
runs-on: ubuntu-22.04
1818
if: github.repository == 'microsoft/playwright-dotnet'
19+
permissions:
20+
id-token: write # This is required for OIDC login (azure/login) to succeed
21+
contents: read # This is required for actions/checkout to succeed
22+
environment: Docker
1923
steps:
2024
- uses: actions/checkout@v4
25+
- name: Azure login
26+
uses: azure/login@v2
27+
with:
28+
client-id: ${{ secrets.AZURE_DOCKER_CLIENT_ID }}
29+
tenant-id: ${{ secrets.AZURE_DOCKER_TENANT_ID }}
30+
subscription-id: ${{ secrets.AZURE_DOCKER_SUBSCRIPTION_ID }}
31+
- name: Login to ACR via OIDC
32+
run: az acr login --name playwright
2133
- name: Setup .NET Core
2234
uses: actions/setup-dotnet@v3
2335
with:
2436
dotnet-version: 8.0.x
2537
- name: Install prerequisites and download drivers
2638
shell: bash
2739
run: ./build.sh --download-driver
28-
- uses: azure/docker-login@v1
29-
with:
30-
login-server: playwright.azurecr.io
31-
username: playwright
32-
password: ${{ secrets.DOCKER_PASSWORD }}
3340
- name: Set up Docker QEMU for arm64 docker builds
3441
uses: docker/setup-qemu-action@v3
3542
with:

0 commit comments

Comments
 (0)