Skip to content

publish-mcr-image

publish-mcr-image #7

name: Push image to MCR
on:
repository_dispatch:
types: [ publish-mcr-image ]
permissions:
contents: write
packages: write
env:
GO_VERSION: '1.22'
IMAGE_NAME: 'workspace'
jobs:
build-publish-mcr-image:
runs-on:
labels: [ "self-hosted", "1ES.Pool=1es-aks-kaito-agent-pool-ubuntu" ]
environment: publish-mcr
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/[email protected]
with:
go-version: ${{ env.GO_VERSION }}
- name: Set Image tag
run: |
ver=${{ github.event.client_payload.tag }}
echo "IMG_TAG=${ver#"v"}" >> $GITHUB_ENV
- uses: actions/[email protected]
with:
fetch-depth: 0
submodules: true
ref: ${{ github.event.client_payload.tag }}
- name: Authenticate to ACR
run: |
az login --identity
az acr login -n ${{ secrets.KAITO_MCR_REGISTRY }}
- name: 'Build and Publish to MCR'
id: Publish
run: |
OUTPUT_TYPE=type=registry make docker-build-workspace
env:
VERSION: ${{ needs.get-tag.outputs.release-tag }}
REGISTRY: ${{ secrets.KAITO_MCR_REGISTRY }}/public/aks/kaito
run-e2e-mcr:
permissions:
contents: read
id-token: write
statuses: write
needs: [ build-publish-mcr-image ]
uses: ./.github/workflows/e2e-workflow.yml
with:
git_sha: ${{ github.sha }}
isRelease: true
registry: "mcr.microsoft.com/aks/kaito"
k8s_version: ${{ vars.AKS_K8S_VERSION }}
tag: ${{ github.event.client_payload.tag }}
create-release:
runs-on: ubuntu-latest
needs: [ run-e2e-mcr ]
steps:
- name: 'Dispatch release tag'
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: create-release
client-payload: '{"tag": "${{ github.event.client_payload.tag }}"}'