Skip to content
name: Legacy Worker Image Deployment - FXCI
on:
workflow_dispatch:
inputs:
config:
type: choice
description: Choose which pool to build
options:
- win10-64-2009-alpha
- win10-64-2009
- win11-64-2009-alpha
- win11-64-2009
jobs:
job1:
name: "Create Image Tasks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: set-matrix
shell: pwsh
run: |
. .github/workflows/tools.ps1
Set-WorkerImageLocation -Key '${{ github.event.inputs.config }}'
outputs:
LOCATIONS: ${{ steps.set-matrix.outputs.LOCATIONS }}
job2:
needs: job1
name: "${{ github.event.inputs.config }} - ${{ matrix.LOCATIONS }}"
runs-on: ubuntu-latest
strategy:
matrix:
locations: ${{fromJson(needs.job1.outputs.LOCATIONS)}}
steps:
- uses: actions/checkout@v3
- name: Azure Login
uses: Azure/login@v1
with:
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID_FXCI }}","clientSecret":"${{ secrets.AZURE_CLIENT_ID_FXCI_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID_UNTRUSTED }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'
enable-AzPSSession: true
- name: "Remove current images"
uses: azure/powershell@v1
with:
inlinescript: |
. .github/workflows/tools.ps1
Remove-WorkerImage -Key "${{ github.event.inputs.config }}" -Location "${{ matrix.LOCATIONS }}"
azPSVersion: "latest"
- name: 'Run Packer'
shell: pwsh
run: |
. .github/workflows/tools.ps1
$Vars = @{
Location = "${{ matrix.LOCATIONS }}"
Key = '${{ github.event.inputs.config }}'
Client_ID = "${{ secrets.AZURE_CLIENT_ID_FXCI }}"
Client_Secret = "${{ secrets.AZURE_CLIENT_ID_FXCI_SECRET }}"
Subscription_ID = "${{ secrets.AZURE_SUBSCRIPTION_ID_UNTRUSTED }}"
Tenant_ID = "${{ secrets.AZURE_TENANT_ID }}"
}
New-WorkerImage @Vars