-
Notifications
You must be signed in to change notification settings - Fork 51
79 lines (70 loc) · 2.27 KB
/
publish-mcr-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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 }}
secrets:
E2E_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
E2E_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
E2E_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
E2E_AMRT_SECRET_NAME: ${{ secrets.AMRT_SECRET_NAME }}
E2E_ACR_AMRT_USERNAME: ${{ secrets.ACR_AMRT_USERNAME }}
E2E_ACR_AMRT_PASSWORD: ${{ secrets.ACR_AMRT_PASSWORD }}
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 }}"}'