Skip to content

Commit

Permalink
Create publish-container-image-icr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dprosper authored Feb 1, 2022
1 parent 53f8b76 commit 2e93a08
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish-container-image-icr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish container image

on:
release:
types: [published]

jobs:
publish_to_registry:
name: Build and push image to registry
runs-on: ubuntu-latest
env:
ICR_NAMESPACE: solution-tutorials
ICR_REPOSITORY: tutorial-application-log-analysis
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Log in to Container Registry
uses: docker/login-action@v1.10.0
with:
registry: icr.io
username: ${{ secrets.ICR_USER }}
password: ${{ secrets.ICR_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3.6.2
with:
images: icr.io/${{ env.ICR_NAMESPACE }}/${{ env.ICR_REPOSITORY }}

- name: Build and push image
uses: docker/build-push-action@v2.8.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 2e93a08

Please sign in to comment.