GCP - gw-fxci-gcp-l1-2404-headless-alpha #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run-name: GCP - ${{ github.event.inputs.config }} | |
name: FXCI - GCP | |
on: | |
workflow_dispatch: | |
inputs: | |
config: | |
type: choice | |
description: Choose which pool to build | |
options: | |
- gw-fxci-gcp-l1-2404-alpha | |
- gw-fxci-gcp-l1-2404-tc | |
- gw-fxci-gcp-l1-2404-gui | |
- gw-fxci-gcp-l1-2404-gui-alpha | |
- gw-fxci-gcp-l1-2404-x11-alpha | |
- gw-fxci-gcp-l1-2404-headless-alpha | |
- gw-fxci-gcp-l1-2404-x11 | |
- gw-fxci-gcp-l1-arm64 | |
- gw-fxci-gcp-l1-arm64-gui | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
config: | |
name: "Get Project ID from Config" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- id: set-matrix | |
shell: pwsh | |
run: | | |
Import-Module ${{ github.workspace }}\bin\WorkerImages\WorkerImages.psm1 | |
Set-GCPWorkerImageProject -Key '${{ github.event.inputs.config }}' | |
outputs: | |
PROJECT: ${{ steps.set-matrix.outputs.PROJECT }} | |
packer: | |
needs: config | |
name: "GCP ${{ github.event.inputs.config }}" | |
runs-on: ubuntu-latest | |
environment: prod | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: 'google-github-actions/auth@v2' | |
id: auth | |
with: | |
workload_identity_provider: "projects/324168772199/locations/global/workloadIdentityPools/github-actions/providers/github-actions" | |
service_account: "deploy-prod@${{ needs.config.outputs.PROJECT }}.iam.gserviceaccount.com" | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v2' | |
- name: 'Run Packer' | |
shell: pwsh | |
run: | | |
Import-Module ${{ github.workspace }}\bin\WorkerImages\WorkerImages.psm1 | |
$Vars = @{ | |
Key = '${{ github.event.inputs.config }}' | |
Worker_Env_Var_Key = "${{ secrets.WORKER_ENV_VAR_KEY }}" | |
TC_worker_cert = "${{ secrets.TC_WORKER_CERT }}" | |
TC_worker_key = "${{ secrets.TC_WORKER_KEY }}" | |
} | |
New-GCPWorkerImage @Vars |