Skip to content

TCEng - win2022-64-2009-alpha #10

TCEng - win2022-64-2009-alpha

TCEng - win2022-64-2009-alpha #10

Workflow file for this run

run-name: TCEng - ${{ github.event.inputs.config }}
name: TCEng
on:
workflow_dispatch:
inputs:
config:
type: choice
description: Choose which pool to build
options:
- win2022-64-2009-alpha
jobs:
config:
name: "Create Image Tasks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: set-matrix
shell: pwsh
run: |
Import-Module ${{ github.workspace }}\bin\WorkerImages\WorkerImages.psm1
Set-AzWorkerImageLocation -Key '${{ github.event.inputs.config }}'
outputs:
LOCATIONS: ${{ steps.set-matrix.outputs.LOCATIONS }}
packer:
needs: config
name: "${{ github.event.inputs.config }} - ${{ matrix.LOCATIONS }}"
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
strategy:
fail-fast: false
matrix:
locations: ${{fromJson(needs.config.outputs.LOCATIONS)}}
steps:
- uses: actions/checkout@v4
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID_TCENG }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_TCENG }}
enable-AzPSSession: true
- name: "Remove current images"
uses: azure/powershell@v2
with:
inlineScript: |
Import-Module ${{ github.workspace }}\bin\WorkerImages\WorkerImages.psm1
Remove-AzWorkerImage -Key "${{ github.event.inputs.config }}" -Location "${{ matrix.LOCATIONS }}"
azPSVersion: "latest"
- name: 'Run Packer'
shell: pwsh
run: |
Import-Module ${{ github.workspace }}\bin\WorkerImages\WorkerImages.psm1
$Vars = @{
Location = "${{ matrix.LOCATIONS }}"
Key = '${{ github.event.inputs.config }}'
Client_ID = "${{ secrets.AZURE_CLIENT_ID_TCENG }}"
oidc_request_url = "${{ env.ACTIONS_ID_TOKEN_REQUEST_URL }}"
oidc_request_token = "${{ env.ACTIONS_ID_TOKEN_REQUEST_TOKEN }}"
Subscription_ID = "${{ secrets.AZURE_SUBSCRIPTION_ID_TCENG }}"
Tenant_ID = "${{ secrets.AZURE_TENANT_ID }}"
Application_ID = "${{ secrets.AZURE_APPLICATION_ID_TCENG }}"
}
New-AzWorkerImage @Vars