Skip to content

Commit

Permalink
Merge pull request #77 from depot/docs/acr-push
Browse files Browse the repository at this point in the history
docs: azure push docs
  • Loading branch information
kylegalbraith authored Jul 26, 2024
2 parents e9464d1 + fa6431d commit 113d599
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions content/integrations/github-actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,48 @@ jobs:
tags: <gcp-region>-docker.pkg.dev/<gcp-project-id>/<your-app>:latest
```

### Build and push an image to Azure Container Registry with OIDC

After adding a [trust relationship](https://depot.dev/docs/cli/authentication#adding-a-trust-relationship-for-github-actions) between Depot and GitHub Actions, you'll be able to log in to Azure Container Registry using the `docker/login-action` and build and push an image to the registry using the `depot/build-push-action` via the image tag(s).

```yaml
name: Build and push to Azure Container Registry
on:
push:
branches:
- main
jobs:
docker-image:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Login to Azure Container Registry
uses: docker/login-action@v2
with:
registry: <registry-name>.azurecr.io
username: ${{ secrets.AZURE_CLIENT_ID }}
password: ${{ secrets.AZURE_CLIENT_SECRET }}
- name: Build and push
uses: depot/build-push-action@v1
with:
# if no depot.json file is at the root of your repo, you must specify the project id
project: <your-depot-project-id>
context: .
push: true
tags: <registry-name>.azurecr.io/<image-name>:<tag>
```

### Build and push to multiple registries

Build and tag an image to push to multiple registries by logging into each one individually.
Expand Down

0 comments on commit 113d599

Please sign in to comment.