Publish Integration Test Container Image #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
name: Publish Integration Test Container Image | |
permissions: | |
# required for OpenID federation | |
contents: 'read' | |
id-token: 'write' | |
jobs: | |
build-and-deploy: | |
environment: container_registry | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout GitHub Action" | |
uses: actions/checkout@main | |
- name: "Az CLI login" | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Login to ACR via OIDC | |
run: | | |
az acr login --name aziotops | |
- name: Determine version from constants | |
run: | | |
echo VERSION=$(sed -n -e 's/^VERSION = "\(.*\)"/\1/p' ./azext_edge/constants.py) >> $GITHUB_ENV | |
- name: Build, tag, and push container image to registry | |
run: | | |
base="aziotops/cli-extension-tests" | |
az acr build -t $base:latest -t $base:${{ github.sha }} -t $base:${{ env.VERSION }} -r aziotops . |