Skip to content

Let's just run PowerShell #21

Let's just run PowerShell

Let's just run PowerShell #21

Workflow file for this run

name: Deploy Kubernetes Cluster
on: workflow_dispatch
permissions:
id-token: write
contents: read
# https://docs.github.com/en/actions/deployment/deploying-to-your-cloud-provider/deploying-to-azure/deploying-to-azure-kubernetes-service
# https://docs.github.com/en/actions/publishing-packages/about-packaging-with-github-actions
jobs:
deploy-bicep:

Check failure on line 13 in .github/workflows/deploy.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy.yaml

Invalid workflow file

You have an error in your yaml syntax on line 13
name: Deploy Bicep
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: azure/login@v1
name: Login to Azure
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true
- name: Run Azure PowerShell script
uses: azure/powershell@v1
with:
inlineScript: |
$Results = New-AzResourceGroupDeployment -Name "aks-$(Get-Date -f yyyyMMddThhmmss)" -ResourceGroupName $Env:RESOURCEGROUP -TemplateFile infrastructure/Cluster.bicep -TemplateParameterObject @{ adminId = $Env:ADMINS }
$Results | Out-Host
#! Get the cluster credentials
Get-AzAksCluster -ResourceGroupName $Env:RESOURCEGROUP |
Import-AzAksCredential -Force
#! Update the client ID from the deployment output
$kustomize = Get-Content "clusters/poschode/flux/kustomization.ps1"
$kustomize = $kustomize -replace "azure.workload.identity/client-id: .*$", "azure.workload.identity/client-id: $($Results.Outputs.fluxIdClientId)"
# TODO: commit this file to the repo _before_ running flux
$kustomize | Set-Content "clusters/poschode/flux/kustomization.ps1"
#! Bootstrap Flux
./infrastructure/Install-Flux.ps1
azPSVersion: "latest"
env:
SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }}
RESOURCEGROUP: ${{ secrets.AZURE_RG }}
ADMINS: ${{ secrets.ADMIN_GROUP_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}